Search code examples
zend-frameworkzend-layout

how to switch to other layout in zend framework?


if i have 2 layout in my application how can change my default layout to other layout for some controller or action?


Solution

  • Here you go:

    $layout = Zend_Layout::getMvcInstance();
    $layout->setLayout('otherlayout');
    

    Where otherlayout is the name of the second layout (otherlayout.phtml in your layouts folder).