Example #1
0
 /**
  * @param Main $main
  */
 public function __construct(Main $main)
 {
     parent::__construct($main);
     $this->_data = array();
     $this->_files = array();
     $this->_method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : self::HTTP_NOTSET;
 }
Example #2
0
 /**
  * @param Main $main
  */
 public function __construct($main)
 {
     parent::__construct($main);
     $this->assetVersion = $main->config->get('assets:version');
     $this->assetPath = $main->getSetting('assetpath');
     $this->_data = array();
     $this->_base = $main->getSetting('templatebase');
     $this->_path = $main->getSetting('templatepath');
 }
Example #3
0
 /**
  * @param array $args
  * @param Main $main
  * @param boolean $public Default public setting
  * @param boolean $sessions Default sessions setting
  * @throws PlinthException
  */
 public function __construct($args, Main $main, $public = false, $sessions = false)
 {
     parent::__construct($main);
     $this->_name = $args['name'];
     $this->_public = $public;
     $this->_sessions = $sessions;
     if (!isset($args['path']) || !isset($args['template']) || !isset($args['methods'])) {
         throw new PlinthException('A route needs to have these parameters: path, template, methods');
     }
     $this->_path = $args['path'];
     $this->_template = $args['template'];
     $this->_methods = $args['methods'];
     if (isset($args['type'])) {
         $this->_type = $args['type'];
     }
     if (isset($args['contentType'])) {
         $this->_contentType = $args['contentType'];
     }
     if (isset($args['pathData'])) {
         $this->_pathData = $args['pathData'];
     }
     if (isset($args['pathDefaultLang'])) {
         $this->_pathDefaultLang = $args['pathDefaultLang'];
     }
     if (isset($args['default'])) {
         $this->_default = $args['default'];
     }
     if (isset($args['headers'])) {
         $this->_headers = $args['headers'];
     }
     if (isset($args['actions'])) {
         $this->_actions = $args['actions'];
     }
     if (isset($args['public'])) {
         $this->_public = $args['public'];
     }
     if (isset($args['sessions'])) {
         $this->_sessions = $args['sessions'];
     }
     if (isset($args['roles'])) {
         $this->_roles = $args['roles'];
     }
     if (isset($args['rolesAllowed'])) {
         $this->_rolesAllowed = $args['rolesAllowed'];
     }
     $this->_cacheSettings = new CacheSettings();
     if (isset($args['caching'])) {
         $this->_cacheSettings->load($args['caching']);
     }
     $this->_data = array();
 }
Example #4
0
 /**
  * @param Main $main
  */
 public function __construct($main)
 {
     parent::__construct($main);
     $this->_fileValidator = new FileValidator();
 }
Example #5
0
 public function __construct($main)
 {
     parent::__construct($main);
     $this->persister = new EntityPersistence();
 }
Example #6
0
 /**
  * ActionType constructor.
  * @param Main $main
  * @param $errorCallback
  */
 public function __construct(Main $main, \Closure $errorCallback)
 {
     parent::__construct($main);
     $this->requestErrorCallback = $errorCallback;
 }