Checking ACL in Zend Navigation when using custom view script

0 Flares Twitter 0 Facebook 0 LinkedIn 0 0 Flares ×

The ZF2 Zend Navigation View Helpers manual shows how to configure your navigation adding ACL.

It also shows how to manually render your navigation inside your view scripts or layout:

Or simply:

So far so good – all of your ACL should work fine and only allowed pages are rendered.

This behaviour changes when you render your pages partially. The manual shows this example code:

This way also not allowed pages will be rendered. In order to get ACL checked you need to use the accept() method:

 

Backlinks:

 

Web Deviloper