Zendframework CSS 问题 [英] Zendframework CSS Problem

查看:31
本文介绍了Zendframework CSS 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 zend 框架工作非常陌生,我正在尝试在本地服务器上设置一个项目(由其他程序员完成),我已经设置了这个项目,但是我的浏览器中的所有页面都是样式,即phtml 页面中没有采用 CSS 文件,为了解决这个问题,我需要编辑哪个文件?

请帮帮我

解决方案

我将在引导文件中添加的全局 css 文件以及与我将添加到相关控制器操作中的页面相关的任何样式,例如...

引导文件中的全局样式

受保护的函数 _initView(){$this->view = new Zend_View();$this->view->headLink()->appendStylesheet('css/global.css');}

或在特定的控制器操作中

公共函数 myPageAction(){$view = $this->view;$view->headLink()->appendStylesheet('css/myPageStyles.css');}

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

解决方案

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');

}

这篇关于Zendframework CSS 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆