/** * Overrides the default method to execute and display a template script to add a back-end page title. * * @param string $tpl The name of the template file to parse * * @return boolean True on success * * @throws \Exception When the layout file is not found */ public function display($tpl = null) { // Set the component's name if (empty($this->componentName)) { $this->componentName = $this->getComponentName(); } // Set the page title if (empty($this->pageTitle)) { $this->pageTitle = $this->getJoomlaPageTitle(); } \JToolbarHelper::title($this->pageTitle); return parent::display($tpl); }
/** * Returns a named View object * * @param string $name The Model name. If null we'll use the modelName * variable or, if it's empty, the same name as * the Controller * @param array $config Configuration parameters to the Model. If skipped * we will use $this->config * * @return View The instance of the Model known to this Controller */ public function getView($name = null, $config = array()) { if (!empty($name)) { $viewName = strtolower($name); } elseif (!empty($this->viewName)) { $viewName = strtolower($this->viewName); } else { $viewName = strtolower($this->view); } if (!array_key_exists($viewName, $this->viewInstances)) { $appName = $this->container->application->getName(); if (empty($config)) { $config = $this->config; } $viewType = $this->input->getCmd('format', 'html'); $this->container['mvc_config'] = $config; $this->viewInstances[$viewName] = View::getInstance($appName, $viewName, $viewType, $this->container); } return $this->viewInstances[$viewName]; }