dongzhouzhang8696 2014-09-17 16:30
浏览 43

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

I'm trying to replace the header.html and footer.html file written in Zend Framework. While the old header was located at application/cache/header.html and footer.html in the same location. I replaced those files with my new header.html and footer.html.

The css and js files and the rest of the code were included in the following manner in the file /application/modules/default/layout/global.phtml:

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

The header and footer were loaded through the following code:

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

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

Later in that page, the header and footer were appended in the following way:

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

After all this, when I open the home page the header and footer appear without any text over them.

Also I've some jQuery written in the header.html file. But none in footer.html file. Is it because of the jQuery or just some error thrown by css?

I searched many forums but was not able to arrive at any results.

I'm a beginner at Zend Framework and all I wanted to do is to change the header and footer file.

Any help would be greatly appreciated.

  • 写回答

1条回答 默认 最新

  • dongsi8812 2014-09-17 16:41
    关注

    First of all this is not recommended way to render views in layout or any other view. You should use <?php print $this->render('path/to/file'); ?> Also show your header and footer files' content.

    评论

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试