title: how to add class to ul element by using zend navigation?
body: <p>i've got a simple navigation menu like this:</p>
  
  <pre><code>$container = new Zend_Navigation();
  $container-&gt;addPage(array(
      'label' =&gt; 'Page 1',
      'uri'   =&gt; 'page-1',
      'foo'   =&gt; 'bar',
      'pages' =&gt; array(
          array(
              'label' =&gt; 'Page 1.1',
              'uri'   =&gt; 'page-1.1',
              'foo'   =&gt; 'bar',
          ),
          array(
              'label' =&gt; 'Page 1.2',
              'uri'   =&gt; 'page-1.2',
              'class' =&gt; 'my-class',
          )
      ),
  ...
  </code></pre>
  
  <p>this will generate :</p>
  
  <pre><code>ul
    li
    li
  </code></pre>
  
  <p>how do i ass a class / id to the <code>ul</code> or to the <code>li</code> ?</p>
  
  <p>any ideas?</p>
  
  <p>thanks</p>
  
  <p>edit: i found a different solution:</p>
  
  <p>i use this function</p>
  
  <pre><code>public static function htmlify($container, $menu_name = null)
  {
      $i = 0;
      $menu = '&lt;ul class="'.$menu_name.'"&gt;';
      foreach($container as $page)
      {
          $menu .= '&lt;li id="'.$page-&gt;htmlfyId.'"&gt;&lt;a id="menu-'.$page-&gt;id.'" class="'.$page-&gt;class.'" href="'.$page-&gt;uri.'"&gt;'.$page-&gt;label.'&lt;/a&gt;';
          $menu .= '&lt;ul id="'.$page-&gt;htmlfyClass.'"&gt;';
  
          foreach($page as $pages)
          {
              $menu .= '&lt;li id="li"&gt;&lt;a class="'.$page-&gt;class.'" href="'.$pages-&gt;uri.'"&gt;'.$pages.'&lt;/a&gt;&lt;/li&gt;';
          }
          $menu .= '&lt;/li&gt;';
          $menu .= '&lt;/ul&gt;';
      }
  return $menu;
  }
  </code></pre>
  
  <p>then in the method that holds the menu add:</p>
  
  <pre><code>    $view = Zend_Layout::getMvcInstance()-&gt;getView();
  
  $menu = self::htmlify($container, 'navigation');
  
      $view-&gt;menu = $menu;
      return $menu;
  </code></pre>
  
  <p>my class has static methods and u have to <code>echo class::method</code> in the view, otherwise just use a regular <code>$this-&gt;menu</code> or whatever.</p>
  
  <p>then u can use it like this:</p>
  
  <pre><code>$container = new Zend_Navigation();
  $container-&gt;addPage(array(
      'label' =&gt; 'Page 1',
      'uri'   =&gt; 'page-1',
      'foo'   =&gt; 'bar',
  
      'htmlfyId' =&gt; 'testing',
      'htmlfyClass' =&gt; 'test',
  
      'pages' =&gt; array(
          array(
              'label' =&gt; 'Page 1.1',
              'uri'   =&gt; 'page-1.1',
              'foo'   =&gt; 'bar',
          ),
          array(
              'label' =&gt; 'Page 1.2',
              'uri'   =&gt; 'page-1.2',
              'class' =&gt; 'my-class',
          )
      ),
  ...
  </code></pre>