开发者

How do I set the class for <ul> tag in multilevel submenu in zend_navigation

开发者 https://www.devze.com 2023-03-10 10:34 出处:网络
I am using an xml file in creating my navigation in a zend framework app. I 开发者_如何学Gohave a multilevel menu like so:

I am using an xml file in creating my navigation in a zend framework app. I 开发者_如何学Gohave a multilevel menu like so:

<config>
<home>
    <label>Home</label>
    <uri>/home</uri>
    <resource>home</resource>
    <id>home</id>
</home>
<register>
    <label>Register</label>
    <uri>/register</uri>
    <resource>register</resource>
    <id>register</id>
</register>
<rates>
    <label>Manage Rates</label>
    <uri>#</uri>
    <resource>managerate</resource>
    <id>managerate</id>
    <pages>
        <charges>
            <label>Transfer Charges</label>
            <uri>/managerates</uri>
        </charges>
        <commission>
            <label>Agent Commission</label>
            <uri>/managerates</uri>
        </commission>
        <exchangerate>
            <label>Exchange Rate</label>
            <uri>/managerates</uri>
        </exchangerate>
    </pages>
</rates>
</config>

The tag renders as a ul tag which wraps around a bunch of li. The overall ul is given a class="navigation". What I want to do is to be able to is assign class attributes to child ul tags, as many levels as the tree goes. Been struggling with this for some time.


Assuming I have understood your question correctly:-

To add a class to any menu item, just add it as an element in your xml file. For example to give your commission menu item the class 'commission':-

<commission>
    <label>Agent Commission</label>
    <uri>/managerates</uri>
    <class>commission</class>
</commission>
0

精彩评论

暂无评论...
验证码 换一张
取 消