I want a view to call 2 different models for use.
Controller.php
class StatsController extends JController {
function display()
{
if( !JRequest::getVar( 'view' ) ) {
JRequest::setVar('view', 'stats' );
}
parent::display();
}
...
...
}
Stats view : (index.php?option=com_stats&view=stats)
class StatsViewStats extends JView
{
function display($tpl = null)
{
$model_helpdesk = & JModel::getInstance('Helpdesk','StatsModel');
//$model_chart = & JModel::getInstance('Chart','StatsModel');
//$model_chart = &$this->getModel('Chart');
var_dump($model_chart);
...
...
parent::display($tpl);
}
}
Problem : getting the Helpdesk model works fine, but getting the Chart model either returns a blanc page , or returns null in var_dump. How can i get this second model for use (without modifying the controller) ??