/** * 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(); }
public function display() { $model = $this->getModel(); $this->assign('state', $model->getState())->assign('activities', $model->getList())->assign('total', $model->getTotal())->assign('sitename', JFactory::getConfig()->getValue('config.sitename'))->assign('base_url', JURI::base())->assign('language', JFactory::getLanguage()->getTag()); return parent::display(); }
/** * 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(); }