我希望页脚内容是动态的,即我希望从数据库中显示一些数据,但页脚不能被任何控制器调用它只是包含在布局部分中,因此.How可以使用数据库连接在页脚中获取动态数据
<header>
<div class="container">
<?php include('header.phtml');?>
<div class="clearfix"></div>
<nav class="navbar navbar-default">
<?php include('menu.phtml');?>
</nav>
<div class="clearfix"></div>
<div class="slider-home">
<?php include('slider.phtml');?>
</div>
<div class="clearfix"></div>
</div>
</header>
<!--Header End-->
<!--Container Start-->
<div class="container orange-panelbg">
<?php echo $this->content; ?>
</div>
<!--Container End-->
<!--Footer Start-->
<footer>
<div class="container">
<?php include('footer-widget.phtml'); ?>
</div>
<div class="clearfix"> </div>
<div class="copyright">
<div class="container">
<?php include('footer.phtml'); ?>
</div>
</div>
</footer>在这里,我使用控制器调用的所有内容都将反映$this内容的更改,因此,如果我更改了方法,那么页脚内容也将更改。我如何实现这一点,或者更确切地说,我使用核心php mysql数据库连接??
发布于 2016-04-02 21:39:34
这里有一篇文章可以帮助你解决这个问题:http://www.michaelgallego.fr/blog/2012/10/06/how-to-replace-the-action-helper-in-zf-2-and-make-great-widgetized-content/
让我知道这是否有帮助,如果有任何进一步的问题被提出。
https://stackoverflow.com/questions/36372357
复制相似问题