title: apply class active to anchor tag in Zend_Navigation
body: <p>i am using partials to decorate Zend_Navigation to fetch desired output. everything is working good except i am having difficulty adding <code>class="active"</code> in <code>&lt;a href..&gt;</code> tag. here is my layout partial <code>sidebar.phtml</code></p>
  
  <pre><code>&lt;ul id="menu" class="nav"&gt;
  &lt;?php foreach($this-&gt;container as $page): ?&gt;
      &lt;li class="&lt;?php echo $page-&gt;class; ?&gt;"&gt;&lt;a href="&lt;?php echo $page-&gt;getHref(); ?&gt;"&gt;&lt;span&gt;&lt;?php echo $page-&gt;label; ?&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;?php endforeach; ?&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>in the <code>&lt;a href="&lt;?php echo $page-&gt;getHref(); ?&gt;"&gt;</code> i want to add <code>class="active"</code> for the current page.</p>
  
  <p>i tried some solutions which i found after searching. but nothing worked for me. </p>
  
  <p>most of the solutions talk about doing it in controller for example</p>
  
  <pre><code>$page = $this-&gt;view-&gt;navigation()-&gt;findOneByLabel('Your Label');
  if ( $page ) {
    $page-&gt;setActive();
  }
  </code></pre>
  
  <p>i haven't tested this yet. as i am using multiple navigations in the layout from one single <code>navigation.xml</code> file. i was wondering if is there a way i could do it in partials itself instead of in controllers or other helpers?</p>
  
  <p>thank you</p>