I know to how to get controller name and action name from layout.phtml file so that i can make dynamic css.
Try this:
Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
Zend_Controller_Front::getInstance()->getRequest()->getActionName();
You shouldn't really have logic in your layout.
Best inject your css from your controller using the headlink container.
So in your controller...
$this->view->headLink()->appendStylesheet('custom_stylesheet.css');
And in your layout...
echo $this->headLink();
Simple as that! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With