Home > Backend Development > PHP Tutorial > zf怎么做共通页面

zf怎么做共通页面

WBOY
Release: 2016-06-13 11:04:03
Original
978 people have browsed it

zf如何做共通页面
比如在View->Scripts—>a文件夹下的a.phtml文件,如果要引入一个View->Scripts—>b文件夹下的b.phtml文件,貌似用include ‘../b/b.phtml’;不行啊,该用什么方法呢?求大神指导
------解决方案--------------------
路径不对吧。。?
------解决方案--------------------
从layout层设置。
------解决方案--------------------
如果是按正常的流程来访问的这个页面的话,也就是通过controller->action来访问a这个页面的话,在代码中使用include这种语句时,根目录应该是在'public'下.所以你这种方式路径当然不对了.不过不推荐这样在任意页面下随意include页面.前端页面公用的部分应该放在layout目录下.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template