Search code examples
joomlajoomla2.5

How to change load layout in Joomla view?


By default parent::display($tpl); loads components/com_my_component/views/my_component/tmpl/default.php, but in some cases i need to load other php file which is in the same folder near default.php (for example components/com_my_component/views/my_component/tmpl/lol.php). How to do this from view.html.php.

P.S.

Tried load loadTemplate and setLayout methods with no luck.


Solution

  • Solved the problem by myself. Need to use the method setLayout and pay attention to the input syntax

    $this->setLayout('dafault:lol');
    parent::display($tpl);