Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend Navigation: current page

There is a method isActive() in Zend_Navigation. But it returns true for all the elements in the current path (parent li is active and all the children too, even when the current is parent li).

Is there any method like isCurrent(), to determine whether the current menu item is the current page?

I just like to add custom class attribute to just one, current element in the whole nested tree of ul's and li's.

like image 757
takeshin Avatar asked Jul 03 '10 07:07

takeshin


1 Answers

easier with:

$activeElement = $view->navigation()->findOneBy('active', 1);

if you're inside your view script you can use:

$activeElement = $this->navigation()->findOneBy('active', 1);
like image 153
Carlos Ribeiro Avatar answered Sep 21 '22 06:09

Carlos Ribeiro