html helper: ul() |
[eluser]fdog[/eluser]
I want to generate an ul using the HTML helper. I need to add a class attribute to an li. desired output: Code: <ul> current controller: Code: $menu = array( Is there a way to pass $attributes to a li instead of the whole ul?
[eluser]Derek Allard[/eluser]
No, there's no way to add attributes to an li unfortunately.
[eluser]Référencement Google[/eluser]
I think it would be good to have this feature Derek, building dynamic menus is the only purpose I can personally find to the html list helper, so it would be good that we can pass to it some attributes.
[eluser]Derek Allard[/eluser]
I don't object to that at all. You want to take a stab at a revised ul() function?
[eluser]Référencement Google[/eluser]
Sorry, my english level do not permit me to understand the word "stab". Do you propose to me that I make this revised function?
[eluser]Derek Allard[/eluser]
I apologize for using slang. Yes, would you like to try making a revised function?
[eluser]Référencement Google[/eluser]
Ok, why not. I can't make that now but I will take a look at it tomorrow (for my local time it means in about 12 hours) Then I will post it here.
[eluser]Référencement Google[/eluser]
hmmm... Derek, looking at the code it seems already possible to pass attributes. The ul function: Code: function ul($list, $attributes = '') The _list function parameters called by the ul function: Code: function _list($type = 'ul', $list, $attributes = '', $depth = 0) Can you confirm it please?
[eluser]Derek Allard[/eluser]
You can add them to the <ul>, but fdog's request was to have them added to the <li>. |
Welcome Guest, Not a member yet? Register Sign In |