public __construct ( Cake\Controller\ComponentRegistry $collection, array $config = [] ) | ||
$collection | Cake\Controller\ComponentRegistry | A ComponentCollection this component can use to lazy load its components. |
$config | array | Array of configuration settings. |
public function __construct(ComponentRegistry $collection, $config = [])
{
$config += ['actions' => [], 'listeners' => []];
$config['actions'] = $this->normalizeArray($config['actions']);
$config['listeners'] = $this->normalizeArray($config['listeners']);
$this->_controller = $collection->getController();
$this->_eventManager = $this->_controller->eventManager();
parent::__construct($collection, $config);
}