-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Set custom class name for active li element #5650
Conversation
Add ability to set custom class name for active "li" element in menu. Example: echo $this->navigation('navigation')->menu() ->setUlClass('uk-navbar-nav uk-hidden-small') ->setLiActiveClass('uk-active') ->setMaxDepth(0) ->setRenderInvisible(false);
There are some problems:
Please look at ZF1 for a complete implementation: I think we should grab the implementation from version 1. |
* Sets CSS class to use for the active 'li' element when rendering | ||
* | ||
* @param string $liActiveClass CSS class to set | ||
* @return Menu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@return self
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samsonasik
At this point the "CS police" is not needed! Because the entire implementation from sopinorg is bad.
@froschdesign @samsonasik thanks for advice! I have added fixes to Menu.php. |
Set custom class name for active li element
- including test asset files often results in additional whitespace at end of string; updated assertion to trim() first.
Merged to develop for release with 2.3.0. |
working on a fix with tests... |
|
Well it is debatable for sure, but after all it's protected, not private. I'll try and work on a fix anyway. |
fix compatibility with zendframework/zendframework#5650
…ch-1 Set custom class name for active li element
- including test asset files often results in additional whitespace at end of string; updated assertion to trim() first.
Add ability to set custom class name for active "li" element in menu.
Example:
echo $this->navigation('navigation')->menu()
->setUlClass('uk-navbar-nav uk-hidden-small')
->setLiActiveClass('uk-active')
->setMaxDepth(0)
->setRenderInvisible(false);