PHP Zend Framework

Authored by Corey Ballou

1 Comment

Specifying a Zend View Paginator Control Partial in a Module-Based Application

If you are utilizing both modules and pagination in your Zend pre-2.0 application (1.6.2 – 1.12.x), you may encounter a scenario where your default PaginationControl view partial does not render. The reason behind this is the fact that the view helper assumes you are looking for the view partial within the current modules directory structure. To get around this issue and use a global view helper, you can pass an array as opposed to a string to Zend_View_Helper_PaginationControl::setDefaultViewPartial as follows:

Zend_View_Helper_PaginationControl::setDefaultViewPartial(array('_partial/paginator.phtml', 'default'));

The first array element represents your view partial and the second specifies it’s module.

Happy coding.

Author: Corey Ballou

Corey Ballou is the CEO of Whether you're a student, young professional, entrepreneur, startup, or small business, you can be up and online fast with your own custom domain, email, and webpage on POP. Corey is a professional PHP developer by trade, specializing in custom web applications development for startups, small businesses, and agencies. Follow Corey on Twitter @cballou.

  • Steve Popoola

    Thank you for this! I had been pulling my hair our because of this for several hours today.