How do you output the Zend pagination control outside of the view?

1.1k Views Asked by At

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');
1

There are 1 best solutions below

2
On BEST ANSWER

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?