更改Zend Framework中的header.html文件会隐藏文本


Changing header.html file in Zend Framework hides the text

我正在尝试替换用Zend Framework编写的header.html和footer.html文件。而旧报头位于CCD_ 1和CCD_。我用新的header.html和footer.html替换了这些文件。

css和js文件以及其余代码以以下方式包含在文件/application/modules/default/layout/global.phtml:中

echo $this->headLink()->appendStylesheet($host . $this->basePath() .'/css/mycssfile.css')
                      ->prependFile($host . $this->basePath() . '/js/myjs.js');

页眉和页脚是通过以下代码加载的:

$headerPath = APPLICATION_PATH . '/cache/header.html';
$headerHtml = file_get_contents($headerPath);
$footerPath = APPLICATION_PATH . '/cache/footer.html';
$footerHtml = file_get_contents($footerPath);

在该页面的后面,页眉和页脚以以下方式附加:

<header id="header_rwd">
<?php echo $headerHtml; ?>
</header>
<footer id="footer_rwd">
<?php echo $footerHtml; ?>

在所有这些之后,当我打开主页时,页眉和页脚出现,上面没有任何文本。

此外,我在header.html文件中编写了一些jQuery。但在footer.html文件中没有。是因为jQuery还是css抛出的一些错误?

我搜索了很多论坛,但没有找到任何结果。

我是Zend Framework的初学者,我只想更改页眉和页脚文件。

如有任何帮助,我们将不胜感激。

首先,不建议使用这种方式在布局或任何其他视图中渲染视图。您应该使用<?php print $this->render('path/to/file'); ?>同时显示页眉和页脚文件的内容。