示例#1
0
 /**
  * Constructor
  *
  * @param \Cake\Controller\ComponentRegistry $registry A ComponentRegistry this component can use to lazy load its components
  * @param array $config Array of configuration settings.
  */
 public function __construct(ComponentRegistry $registry, array $config = [])
 {
     $this->_registry = $registry;
     $controller = $registry->getController();
     if ($controller) {
         $this->request =& $controller->request;
         $this->response =& $controller->response;
     }
     $this->config($config);
     if (!empty($this->components)) {
         $this->_componentMap = $registry->normalizeArray($this->components);
     }
     $this->initialize($config);
 }
示例#2
0
 /**
  * Constructor
  *
  * @param ComponentRegistry $registry A ComponentRegistry this component can use to lazy load its components
  * @param array $config Array of configuration settings.
  */
 public function __construct(ComponentRegistry $registry, array $config = [])
 {
     $this->_registry = $registry;
     $this->config($config);
     if (!empty($this->components)) {
         $this->_componentMap = $registry->normalizeArray($this->components);
     }
     $this->initialize($config);
 }