__construct() public method

modelConfig array The configuration overrides for the Model.
public __construct ( Container $container, array $config = [] ) : Controller
$container FOF30\Container\Container The application container
$config array The configuration array
return Controller
Beispiel #1
0
 /**
  * Assigns callback functions to the class, the $methods array should be an associative one, where
  * the keys are the method names, while the values are the closure functions, e.g.
  *
  * array(
  *    'foobar' => function(){ return 'Foobar'; }
  * )
  *
  * @param           $container
  * @param array     $config
  * @param array     $methods
  */
 public function __construct(Container $container, array $config = array(), array $methods = array())
 {
     foreach ($methods as $method => $function) {
         $this->mockedMethods[$method] = $function;
     }
     parent::__construct($container, $config);
 }
Beispiel #2
0
 public function __construct(Container $container, array $config)
 {
     if (!is_array($config)) {
         $config = [];
     }
     $config['modelName'] = 'Statistics';
     parent::__construct($container, $config);
 }
Beispiel #3
0
 /**
  * Public constructor of the Controller class. You can pass the following variables in the $config array,
  * on top of what you already have in the base Controller class:
  *
  * taskPrivileges       array   ACL privileges for each task
  * cacheableTasks       array   The cache-enabled tasks
  *
  * @param   Container  $container  The application container
  * @param   array      $config     The configuration array
  */
 public function __construct(Container $container, array $config = array())
 {
     parent::__construct($container, $config);
     // Set up a default model name if none is provided
     if (empty($this->modelName)) {
         $this->modelName = $container->inflector->pluralize($this->view);
     }
     // Set up a default view name if none is provided
     if (empty($this->viewName)) {
         $this->viewName = $container->inflector->pluralize($this->view);
     }
     if (isset($config['cacheableTasks'])) {
         if (!is_array($config['cacheableTasks'])) {
             $config['cacheableTasks'] = explode(',', $config['cacheableTasks']);
             $config['cacheableTasks'] = array_map('trim', $config['cacheableTasks']);
         }
         $this->cacheableTasks = $config['cacheableTasks'];
     }
     if (isset($config['taskPrivileges']) && is_array($config['taskPrivileges'])) {
         $this->taskPrivileges = array_merge($this->taskPrivileges, $config['taskPrivileges']);
     }
 }
Beispiel #4
0
 public function __construct(Container $container, array $config)
 {
     parent::__construct($container, $config);
     $this->setPredefinedTaskList(['wizard', 'checkUrl', 'applyConnection', 'initialiseUpload', 'upload', 'reset']);
 }
 public function __construct(Container $container, array $config)
 {
     parent::__construct($container, $config);
     $this->setPredefinedTaskList(['main', 'ajax']);
 }
Beispiel #6
0
 public function __construct(Container $container, array $config = array())
 {
     parent::__construct($container, $config);
     $this->predefinedTaskList = ['force'];
 }
Beispiel #7
0
 public function __construct(Container $container, array $config = array())
 {
     // Tell our controller to use the Releases model
     $config['modelName'] = 'Releases';
     parent::__construct($container, $config);
 }
Beispiel #8
0
 public function __construct(Container $container, array $config = array())
 {
     parent::__construct($container, $config);
     $this->setPredefinedTaskList(['main', 'SwitchProfile', 'UpdateInfo', 'applydlid', 'resetSecretWord', 'reloadUpdateInformation']);
 }
Beispiel #9
0
 public function __construct(Container $container, array $config = array())
 {
     parent::__construct($container, $config);
     $this->predefinedTaskList = ['main', 'category', 'upload', 'delete', 'newFolder'];
 }
Beispiel #10
0
 public function __construct(Container $container, array $config = array())
 {
     parent::__construct($container, $config);
     $this->predefinedTaskList = ['main', 'updategeoip', 'updateinfo'];
 }