views:

186

answers:

2

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 accomplished? How?

Thanks!

+1  A: 

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();.

takeshin
A: 

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.

Sonny