joomla3.0 - Multiple models - no data retrieved -
i trying use multiple models in view. view single items , models lists displayed within view using tabs.
in controller added setmodel in display function
class compliancecontrollercompliance extends jcontrollerform { public function display( $cachable = false, $urlparam = array() ) { $view = $this->getview( 'myview', 'html' ); $view->setmodel( $this->getmodel( 'mymodel' ), true ); $view->setmodel( $this->getmodel( 'content' ) ); $view->display(); }
in view try access needed information this
$this->content_items = $this->get( 'items', 'content' ); $this->content_pagination = $this->get( 'pagination', 'content' ); $this->content_state = $this->get( 'state', 'content' );
but dont information.
what doing wrong?
the basis of working multiple models finding way instance of each model. issue $this->getmodel('yourmodelname')
returns false.
test part works:
$testmodel = $this->getmodel('yourmodelname'); var_dump($testmodel);
i guess have studied using multiple models in mvc component article.
Comments
Post a Comment