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