4

我正在 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');
4

1 回答 1

2

You can access the view object in the controller with $this->view. So you should be able to echo it like this:

echo $this->view->paginationControl($this->view->oPaginator, 'Sliding', 'pagination-control.phtml');

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?

于 2011-11-21T11:10:33.697 回答