protected function _create($class, $alias, $config)
    {
        $instance = new $class($this, $config);
        $enable = isset($config['enabled']) ? $config['enabled'] : true;
        if ($enable) {
            $this->getEventManager()->on($instance);
        }

        return $instance;
    }
protected function _create($class, $alias, $config)
    {
        $instance = new $class($this, $config);
        $enable = isset($config['enabled']) ? $config['enabled'] : true;
        if ($enable) {
            $this->getEventManager()->on($instance);
        }

        return $instance;
    }
protected function _create ( $ class , $ alias , $ config ) { $ instance = new $ class ( $ this , $ config ) ; $ enable = isset ( $ config [ 'enabled' ] ) ? $ config [ 'enabled' ] : true ; if ( $ enable ) { $ this -> getEventManager ( ) -> on ( $ instance ) ; } return $ instance ; }
Create the component instance.

Part of the template method for Cake\Core\ObjectRegistry::load()
Enabled components will be registered with the event manager.

@param string $class The classname to create.
@param string $alias The alias of the component.
@param array $config An array of config to use for the component.
@return \Cake\Controller\Component The constructed component class.
Create the component instance .