Zendframework CSS Problem

半世苍凉 提交于 2019-12-24 21:45:19

问题


I am very to new to zend frame work , I am trying to set up a project (Done by other programmer) in my local server, i have setted up this project, but all pages are styless in my browser, ie the CSS files are not taken in phtml pages, For solving this issue which file I have ti Edit?

Plss Help me


回答1:


It depends upon the directory structure that your app has adapted. However checkout if you have views/scripts directory then, again depending upon the directory style used, the header.phtml file (if exist) will have invalid link to css.

If you dont have header.phtml, then use any text-editor and search in your views directory with keyword 'css', and you will get to know the possible file name.




回答2:


Global css files I would add in the bootstrap file and any styles that relate to a page I would add in the relevant controller action for example...

global styles in bootstrap file

protected function _initView()
    {
        $this->view = new Zend_View();
        $this->view->headLink()->appendStylesheet('css/global.css');
    }

or in a specific controller action

public function myPageAction()
{
   $view = $this->view;
   $view->headLink()->appendStylesheet('css/myPageStyles.css');

}


来源:https://stackoverflow.com/questions/1665504/zendframework-css-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!