/** * Prepend the xml prolog * * @param KViewContext $context A view context object * @return string The output of the view */ protected function _actionRender(KViewContext $context) { //Prepend the xml prolog $result = '<?xml version="1.0" encoding="utf-8" ?>'; $result .= parent::_actionRender($context); return $result; }
/** * Return the views output * * This function will auto assign the model data to the view if the auto_assign * property is set to TRUE. * * @return string The output of the view */ public function display() { if(empty($this->output)) { $model = $this->getModel(); //Auto-assign the state to the view $this->assign('state', $model->getState()); //Auto-assign the data from the model if($this->_auto_assign) { //Get the view name $name = $this->getName(); //Assign the data of the model to the view if(KInflector::isPlural($name)) { $this->assign($name, $model->getList()) ->assign('total', $model->getTotal()); } else $this->assign($name, $model->getItem()); } } return parent::display(); }
/** * Get a route based on a full or partial query string. * * This function force the route to be not fully qualified. * * @param string The query string used to create the route * @param boolean If TRUE create a fully qualified route. Default TRUE. * @return string The route */ public function getRoute($route = '', $fqr = true) { return parent::getRoute($route, false); }
public function setLayout($layout) { //Don't allow to change the layout return parent::setLayout($this->_layout); }
/** * Render the toolbar * * @throws KToolbarException When the button could not be found * @return View Object */ public function render() { if (KRequest::has('get.id', 'int')) { KFactory::get('admin::com.ninja.helper.default')->js('window.addEvent(\'domready\',function(){$(\'' . KFactory::get('admin::com.ninja.helper.default')->formid() . '\').validate();});'); } $this->buttons = $this->_buttons; return parent::display(); }
/** * Force the route to be not fully qualified and escaped * * @param string|array $route The query string used to create the route * @param boolean $fqr If TRUE create a fully qualified route. Default FALSE. * @param boolean $escape If TRUE escapes the route for xml compliance. Default TRUE. * @return KDispatcherRouterRoute The route */ public function getRoute($route = '', $fqr = false, $escape = true) { return parent::getRoute($route, $fqr, $escape); }