Re: PEAR HTML_Menu
| From: | Alexey Borzov | Date: | Tue, 08 Jun 2010 08:28:14 +0000 |
| Subject: | Re: PEAR HTML_Menu | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-30611@lists.php.net to get a copy of this message | ||
Hi Jamie,
On 07.06.2010 19:51, Jamie Kahgee wrote:
If I wanted to apply an id/class to the last parent item in a menu - is it
possible w/out modifying this script?
I'm using the HTML_Menu_DirectTreeRenderer and need a marker on the last
<li> in the main list
ie:
<ul>
<li>Menu item 1
<ul>
<li>Menu item 1.1</li>
<li>Menu item 1.2</li>
</ul>
</li>
<li* id="lastli"*>Menu item 2</li> <-- need to add class here
</ul>
The Renderer will substitute any custom keys you add to the menu element array. If you set item template to <li{attributes}>, </li> and then pass an array containing key ('attributes' => ' id="lastli"') as the last element on level, the output will be as above.