Cmenu & linkLabelWrapper

First let me say that I’m a relative newbie to Yii in the sense that OOP just “clicked” for me within the last week. I searched on this topic but wasn’t able to find an answer yet.

The issue is: I have a template that I’m using for a new Yii site, which expects menu items, and their sub-items to be in the format below:




<ul id="menu" class="nav">

  <li class="dash"><a href="index.html" title="" class="active"><span>Home</span></a></li>

    <ul class="sub">

      <li><a href="account.html" title="">Account Home</a></li>

    </ul>

  </li>

</ul>

I can get the main menu items to display just fine using the various options in the CMenu class, however the issue I’m having is with the submenu. While the main menu items have to be wrapped in SPAN tags to display properly, the submenu items cannot be.

So far I’ve been unable to get CMenu to display them differently…since I’ve set linkLabelWrapper => ‘span’ on the main items, it’s also applying that to the submenu items.

At this point I assume my option would be to extend the CMenu class to make it behave how I want, but I’m open to suggestions. (I’d prefer not to mess with the CSS

You could use MbMenu

Thanks. MbMenu seems pretty powerful but still didn’t do exactly what I needed so I just ended up extending the CMenu class and creating a new method that handles the submenu items differently.