protected function _init()
 {
     parent::_init();
     if (!empty($this->_config['request']) && is_object($this->_config['request'])) {
         $this->type = $this->_config['request']->type();
     }
 }
Example #2
0
 /**
  * Sets the Location header using `$config['location']` and `$config['request']` passed in
  * through the constructor if provided.
  *
  * @return void
  */
 protected function _init()
 {
     parent::_init();
     $router = $this->_classes['router'];
     if ($this->_config['location']) {
         $location = $router::match($this->_config['location'], $this->_config['request']);
         $this->headers('Location', $location);
     }
 }
 protected function _init()
 {
     parent::_init();
     $config = $this->_config;
     $this->status($config['status']);
     unset($this->_config['status']);
     if ($config['location']) {
         $classes = $this->_classes;
         $location = $classes['router']::match($config['location'], $config['request']);
         $this->headers('Location', $location);
     }
 }
Example #4
0
 protected function _init()
 {
     $this->status($this->_config['status']);
     unset($this->_config['status']);
     if ($this->_config['request'] && is_object($this->_config['request'])) {
         $this->_type = $this->_config['request']->accepts();
     }
     if ($this->_config['location']) {
         $router = $this->_classes['router'];
         $location = $router::match($this->_config['location'], $this->_config['request']);
         $this->headers('location', $location);
     }
     parent::_init();
 }