如何在joomla控制器中加载不同的视图?

use*_*333 3 joomla joomla2.5

我有简单的线条,但它不起作用.

$this->getView($input->get('my_wiew', 'Sites', 'CMD'), 'HTML');
//some code
parent::display();
Run Code Online (Sandbox Code Playgroud)

如果我简单地转到网址index.php?option=com_my_component&view=sites我得到我的视图,但默认情况下它不想加载.

Tec*_*hie 5

$view   = $this->getView('view_name', 'html'); //get the view
$view->assignRef('data', $data_from_model); // assign data from the model
$view->display(); // display the view
Run Code Online (Sandbox Code Playgroud)

阅读更多