user1692333
user1692333

Reputation: 2597

How to load different view in joomla controller?

I have simple line, but it doesn't work.

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

If i simple go to the url index.php?option=com_my_component&view=sites i get my view, but by default it doesn't want to load.

Upvotes: 3

Views: 5277

Answers (1)

Techie
Techie

Reputation: 45124

$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

Read more

Upvotes: 5

Related Questions