I have a controller and want to define or render custom layout for different parameters passed from user to it:
public function myactionAction() {
$this->loadLayout();
$params = $this->getRequest()->getParams();
if(array_key_exists('customaction', $params)){
// default layout
...
}
elseif(array_key_exists('another_subaction', $params))
{
// different layout
...
}
i tried some xml in layouts:
<mymodulerouter_mycontroller_myaction_customaction>
<reference name="root">
<action method="setTemplate"><template>customer/custom.phtml</template></action>
</reference>
</mymodulerouter_mycontroller_myaction_customaction>
but no success, is it possible to to this is magento or i should register another controller?