english/administrator/components/com_categories/controller.php
/**
	 * Method to display a view.
	 *
	 * @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
	 */
Method to display a view.
@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  JFilterInput::clean().

@return      JController             This object to support chaining.
Method to display a view . @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 JFilterInput :: clean () . @return JController This object to support chaining .
public function display($cachable = false, $urlparams = false)
	{
		$document = JFactory::getDocument();
		$vName		= JRequest::getCmd('view', 'categories');
		$vFormat	= $document->getType();
		$lName		= JRequest::getCmd('layout', 'default');
		$id			= JRequest::getInt('id');
		if ($vName == 'category' && $lName == 'edit' && !$this->checkEditId('com_categories.edit.category', $id)) {
			$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
			$this->setMessage($this->getError(), 'error');
			$this->setRedirect(JRoute::_('index.php?option=com_categories&view=categories&extension='.$this->extension, false));
			return false;
		}
		if ($view = $this->getView($vName, $vFormat)) {
			$model = $this->getModel($vName, 'CategoriesModel', array('name' => $vName . '.' . substr($this->extension, 4)));
			$view->setModel($model, true);
			$view->setLayout($lName);
			$view->assignRef('document', $document);
			require_once JPATH_COMPONENT.'/helpers/categories.php';
			CategoriesHelper::addSubmenu($model->getState('filter.extension'));
			$view->display();
		}
		return $this;
	}
public function display ( $ cachable = false , $ urlparams = false ) { $ document = JFactory :: getDocument ( ) ; $ vName = JRequest :: getCmd ( 'view' , 'categories' ) ; $ vFormat = $ document -> getType ( ) ; $ lName = JRequest :: getCmd ( 'layout' , 'default' ) ; $ id = JRequest :: getInt ( 'id' ) ; if ( $ vName == 'category' && $ lName == 'edit' && ! $ this -> checkEditId ( 'com_categories.edit.category' , $ id ) ) { $ this -> setError ( JText :: sprintf ( 'JLIB_APPLICATION_ERROR_UNHELD_ID' , $ id ) ) ; $ this -> setMessage ( $ this -> getError ( ) , 'error' ) ; $ this -> setRedirect ( JRoute :: _ ( 'index.php?option=com_categories&view=categories&extension=' . $ this -> extension , false ) ) ; return false ; } if ( $ view = $ this -> getView ( $ vName , $ vFormat ) ) { $ model = $ this -> getModel ( $ vName , 'CategoriesModel' , array ( 'name' => $ vName . '.' . substr ( $ this -> extension , 4 ) ) ) ; $ view -> setModel ( $ model , true ) ; $ view -> setLayout ( $ lName ) ; $ view -> assignRef ( 'document' , $ document ) ; require_once JPATH_COMPONENT . '/helpers/categories.php' ; CategoriesHelper :: addSubmenu ( $ model -> getState ( 'filter.extension' ) ) ; $ view -> display ( ) ; } return $ this ; }
Method to display a view.
Method to display a view .
// Get the document object. // Set the default view name and format from the Request. // Check for edit form. // Somehow the person just went to the form - we don't allow that. // Get and render the view. // Get the model for the view. // Push the model into the view (as default). // Push document object into the view. // Load the submenu.