Generic Pagination in ZF2

pagination, php, zend-framework2

Solution

Dear which you want to do is clearly mentioned in zf2 documentation: http://framework.zend.com/manual/2.1/en/tutorials/tutorial.pagination.html "Let’s create the partail in the module/Application/view/partial/ folder, so that we can use the control in all our modules:" Above mention line shows that if we want to make pagination generic which will be available for all module, then make it partial in Application module.

Problem

EDIT My question is how to make pagination on View generic, currently what i have to do is some what like this on every page where i need pagination variables set ``` <?php echo ( count($this->paginator) > 0 ) ? $this->paginationControl($this->paginator, 'Sliding', 'administration/pager.phtml', array('url' => $this->url('company'))) : ""; ?> ```

Original source