怎么zend framework引用header文件

WBOY
Release: 2016-06-13 11:54:00
Original
997 people have browsed it

如何zend framework引用header文件
我在index.phtml中用引用不到header.phtml文件,但是我
1111就可以链接此文件。如果我把header.phtml放到public文件夹里,到是可以引用,但以后在头部文件添加数据就不行了,请问如何引用文件?
------解决方案--------------------
include 进来的是物理存在的文件,而你这个是映射到某个action的,其实物理上不存在的。在zf中引用是这么写的:

action("link", "index", "default");?>

default为模块名
index为控制器名字link为action名称
------解决方案--------------------

<br /><br />echo $this->render("globals/header.phtml");<br />
Copy after login

------解决方案--------------------
启用layout布局功能吧,然后在布局layout.phtml文件里加入如下代码


    echo $this->partial('header.phtml');
?>

仅供参考

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