Xpressengine\Plugin\PluginRegister::addByEntity PHP Méthode

addByEntity() public méthode

주어진 플러그인에 포함된 component를 register에 등록한다.
public addByEntity ( PluginEntity $entity ) : void
$entity PluginEntity 플러그인
Résultat void
    public function addByEntity(PluginEntity $entity)
    {
        $componentList = $entity->getComponentList();
        foreach ($componentList as $id => $info) {
            $info['id'] = $id;
            $this->setComponentInfo($info);
            $this->add($info['class']);
        }
    }

Usage Example

 /**
  * 플러그인을 부트한다.
  *
  * @param PluginEntity $entity 부트시킬 플러그인
  *
  * @return void
  */
 public function bootPlugin(PluginEntity $entity)
 {
     $pluginObj = $entity->getObject();
     // register & boot plugin's components
     $this->register->addByEntity($entity);
     $entity->bootComponents();
     // bind plugin to application
     $this->app->instance(get_class($pluginObj), $pluginObj);
     // boot plugin
     $pluginObj->boot();
     $this->registerViewNamespace($entity);
 }