我知道如何从layout.phtml文件中获取控制器名称和操作名称,以便我可以制作动态css.
Ash*_*ley 45
试试这个:
Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
Zend_Controller_Front::getInstance()->getRequest()->getActionName();
Run Code Online (Sandbox Code Playgroud)
小智 6
你的布局中不应该有逻辑.
最好使用headlink容器从控制器注入你的css.
所以在你的控制器......
$this->view->headLink()->appendStylesheet('custom_stylesheet.css');
在你的布局......
echo $this->headLink();
就那么简单!:)
| 归档时间: |
|
| 查看次数: |
21532 次 |
| 最近记录: |