Example #1
0
 /**
  * Constructor
  *
  * @param \Cake\Controller\ComponentRegistry $collection Component Registry
  * @param array $config Array of configuration settings.
  */
 public function __construct(ComponentRegistry $collection, $config = [])
 {
     $this->_controller = $collection->getController();
     $this->_eventManager = $this->_controller->eventManager();
     parent::__construct($collection, $config);
     $this->_createCrudComponentInstance();
 }
 /**
  * Constructor. Parses the accepted content types accepted by the client using HTTP_ACCEPT
  *
  * @param ComponentRegistry $registry ComponentRegistry object.
  * @param array $config Config options array
  */
 public function __construct(ComponentRegistry $registry, $config = [])
 {
     $this->_defaultConfig = Hash::merge($this->_defaultConfig, $this->_translateConfigMessages(), (array) Configure::read('UserTools.Component'));
     $this->_controller = $registry->getController();
     $this->response = $this->_controller->response;
     parent::__construct($registry, $config);
 }
 /**
  * Constructor.
  *
  * @param \Cake\Controller\ComponentRegistry $collection
  * @param array $config
  */
 public function __construct(ComponentRegistry $collection, $config = [])
 {
     $this->Controller = $collection->getController();
     $defaults = (array) Configure::read('Ajax') + $this->_defaultConfig;
     $config += $defaults;
     parent::__construct($collection, $config);
 }
 /**
  * Constructor
  *
  * @param ComponentRegistry $registry The controller for this request.
  * @param array $config An array of config. This class does not use any config.
  */
 public function __construct(ComponentRegistry $registry, array $config = array())
 {
     $this->_registry = $registry;
     $controller = $registry->getController();
     $this->controller($controller);
     $this->config($config);
 }
 /**
  * Class constructor
  *
  * @param Cake\Controller\ComponentRegistry $collection ComponentRegistry instance.
  * @param array $config Configuration options
  * @return void
  */
 public function __construct(\Cake\Controller\ComponentRegistry $collection, array $config)
 {
     pr("AppPlusPlus __construct()");
     // make calling controller available
     $this->_controller = $collection->getController();
     // Enable Authentication if needed
     if ($this->Config('Authentication.enabled')) {
         $this->setupAuth();
     }
     // Load components for the calling calling controller
     $this->_controller->loadComponent('RequestHandler');
     $this->_controller->loadComponent('Flash');
     $this->_controller->loadComponent('Crud.Crud', ['actions' => ['Crud.Index', 'Crud.Add', 'Crud.Edit', 'Crud.View', 'Crud.Delete'], 'listeners' => ['Crud.Api', 'Crud.ApiPagination', 'Crud.ApiQueryLog']]);
     $this->_controller->loadComponent('Paginator', ['settings' => ['page' => 1, 'limit' => 25, 'maxLimit' => 100, 'whitelist' => ['limit', 'sort', 'page', 'direction']]]);
     //$this->_eventManager = $this->_controller->eventManager();
     parent::__construct($collection, $config);
 }
Example #6
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);
 }
Example #7
0
 /**
  * Constructor
  *
  * @param \Cake\Controller\ComponentRegistry $collection A ComponentCollection this component
  *   can use to lazy load its components.
  * @param array $config 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);
 }