Example #1
0
 /**
  * Set the request of the response
  * 
  * (non-PHPdoc)
  * @see LibBaseControllerAbstract::getResponse()
  */
 public function getResponse()
 {
     if (!$this->_response instanceof LibBaseDispatcherResponse) {
         $this->_response = parent::getResponse();
         if (!$this->_response instanceof LibBaseDispatcherResponse) {
             throw new InvalidArgumentException('Response: ' . get_class($this->_response) . ' must be an intance of LibBaseDispatcherResponse');
         }
         $this->_response->setRequest($this->getRequest());
     }
     return $this->_response;
 }
Example #2
0
 /**
  * Get a toolbar by identifier.
  *
  * @return KControllerToolbarAbstract
  */
 public function getToolbar($toolbar, $config = array())
 {
     if (is_string($toolbar)) {
         if (strpos($toolbar, '.') === false) {
             $identifier = clone $this->getIdentifier();
             $identifier->path = array('controller', 'toolbar');
             $identifier->name = $toolbar;
             register_default(array('identifier' => $identifier, 'prefix' => $this));
             $toolbar = $identifier;
         }
     }
     return parent::getToolbar($toolbar, $config);
 }