开发者

Finding if the current page is in a Zend Navigation object

开发者 https://www.devze.com 2022-12-24 23:09 出处:网络
I have more than one Zend_Navigation object in my application.I want to do a test to find out which object holds the page I\'m currently on.I didn\'t see methods for doing that in the documentation.Ca

I have more than one Zend_Navigation object in my application. I want to do a test to find out which object holds the page I'm currently on. I didn't see methods for doing that in the documentation. Can this be accomp开发者_StackOverflow中文版lished? How?

Thanks!


AFAIK there is no public method to do compare all pages in the container recursively at once.

You may implement your own method iterating all the pages and the subpages in the container (Zend_Navigation implements RecursiveIterator) and check $container->isActive() status or compare container params with the current $request->getParams();.


I ended up using the findById() function after using some logic very specific to my implementation to determine which navigation object applied to the current request.

0

精彩评论

暂无评论...
验证码 换一张
取 消