/** * @param boolean If true, the view output will be cached * @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * @since 1.5 */ public function display($cachable = false, $urlparams = false) { require_once JPATH_COMPONENT . '/helpers/cache.php'; // Get the document object. $document = JFactory::getDocument(); // Set the default view name and format from the Request. $vName = JRequest::getCmd('view', 'cache'); $vFormat = $document->getType(); $lName = JRequest::getCmd('layout', 'default'); // Get and render the view. if ($view = $this->getView($vName, $vFormat)) { switch ($vName) { case 'purge': break; case 'cache': default: $model = $this->getModel($vName); $view->setModel($model, true); break; } $view->setLayout($lName); // Push document object into the view. $view->assignRef('document', $document); // Load the submenu. CacheHelper::addSubmenu(JRequest::getCmd('view', 'cache')); $view->display(); } }
/** * Display a view. * * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * * @since 1.5 */ public function display($cachable = false, $urlparams = false) { JLoader::register('CacheHelper', JPATH_ADMINISTRATOR . '/components/com_cache/helpers/cache.php'); // Get the document object. $document = JFactory::getDocument(); // Set the default view name and format from the Request. $vName = $this->input->get('view', 'cache'); $vFormat = $document->getType(); $lName = $this->input->get('layout', 'default', 'string'); // Get and render the view. if ($view = $this->getView($vName, $vFormat)) { switch ($vName) { case 'purge': break; case 'cache': default: $model = $this->getModel($vName); $view->setModel($model, true); break; } $view->setLayout($lName); // Push document object into the view. $view->document = $document; // Load the submenu. CacheHelper::addSubmenu($this->input->get('view', 'cache')); $view->display(); } }