如何在视图之外输出 Zend 分页控件?
我正在 Zend 框架中创建一个包装类来封装一些数据输出和分页控件。
如何从控制器中的视图输出这一行:
<?= $this->paginationControl($this->oPaginator, 'Sliding', 'pagination-control.phtml')?>
提前致谢。
...回答我自己的问题:
$this->view->oPaginator = $this->oPaginator;
echo $this->view->paginationControl($this->view->oPaginator, 'Sliding', 'pagination-control.phtml');
I'm creating a wrapper class in the Zend framework to encapsulate some data output and the pagination control.
How do I output this line from the view in the controller:
<?= $this->paginationControl($this->oPaginator, 'Sliding', 'pagination-control.phtml')?>
Thanks in advance.
...Answered my own question:
$this->view->oPaginator = $this->oPaginator;
echo $this->view->paginationControl($this->view->oPaginator, 'Sliding', 'pagination-control.phtml');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
$this->view
访问控制器中的view
对象。所以你应该能够像这样回显它:但我认为如果你需要在控制器中回显它,你的应用程序就会出现问题。你为什么要这样做?
You can access the
view
object in the controller with$this->view
. So you should be able to echo it like this:But I think there something wrong with your application if you need to echo this in the controller. Why do you want to do this?