references:joomla.framework:application:jview-setmodelsetModel
Adds a model to the view. The system supports a multiple model single view system by which models are referenced by classname. A caveat to the classname referencing is that any classname prepended by JModel will be referenced by the name without JModel, eg. JModelCategory is just Category. The method returns a reference to the JModel object that was added to the view. SyntaxJModel &setModel ( &$model, $default, $model )
ExamplesThe setModel method could be called in the following way from within the JController class: Example // Push a model into the view $model = &$this->getModel( $viewName ); if (!JError::isError( $model )) { $view->setModel( $model, true ); } |


