Ejemplo n.º 1
0
 /**
  * Method to set a view object attached to the controller.
  *
  * @param  mixed                    $view An object that implements KObjectIdentifiable, an object that
  *                                        implements KIndentifierInterface or valid identifier string
  *
  * @throws KDatabaseRowsetException If the identifier is not a view identifier
  *
  * @return KControllerAbstract
  */
 public function setView($view)
 {
     parent::setView($view);
     if (!$this->_view instanceof LibBaseViewAbstract) {
         unregister_default($this->_view);
     }
 }
Ejemplo n.º 2
0
 /**
  * Set the default Node View
  * 
  * @param KCommandContext $context Context parameter
  * 
  * @return ComBaseControllerService
  */
 public function setView($view)
 {
     parent::setView($view);
     if (!$this->_view instanceof ComBaseViewAbstract) {
         $name = KInflector::isPlural($this->view) ? 'nodes' : 'node';
         $defaults[] = 'ComBaseView' . ucfirst($view) . ucfirst($this->_view->name);
         $defaults[] = 'ComBaseView' . ucfirst($name) . ucfirst($this->_view->name);
         $defaults[] = 'ComBaseView' . ucfirst($this->_view->name);
         register_default(array('identifier' => $this->_view, 'default' => $defaults));
     }
     return $this;
 }