Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Set custom class name for active li element #5650

Closed
wants to merge 8 commits into from
Closed

Set custom class name for active li element #5650

wants to merge 8 commits into from

Conversation

k8ns
Copy link
Contributor

@k8ns k8ns commented Dec 30, 2013

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);

k8ns added 3 commits December 30, 2013 04:00
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);
@froschdesign
Copy link
Member

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@return self

Copy link
Member

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.

@k8ns
Copy link
Contributor Author

k8ns commented Dec 31, 2013

@froschdesign @samsonasik thanks for advice! I have added fixes to Menu.php.

@weierophinney weierophinney added this to the 2.3.0 milestone Mar 3, 2014
@weierophinney weierophinney self-assigned this Mar 4, 2014
weierophinney added a commit that referenced this pull request Mar 4, 2014
Set custom class name for active li element
weierophinney added a commit that referenced this pull request Mar 4, 2014
- trailing whitespace
- s/@return Menu/@return self/ throughout
weierophinney added a commit that referenced this pull request Mar 4, 2014
- including test asset files often results in additional whitespace at
  end of string; updated assertion to trim() first.
weierophinney added a commit that referenced this pull request Mar 4, 2014
@weierophinney
Copy link
Member

Merged to develop for release with 2.3.0.

@froschdesign
Copy link
Member

@stefanotorresi
?

@stefanotorresi
Copy link
Contributor

$liActiveClass parameter in renderNormalMenu() and renderDeepestMenu() not being optional causes a strict error for any Menu subclass. there are plenty of modules that extends it for custom menu rendering.

working on a fix with tests...

@froschdesign
Copy link
Member

renderNormalMenu and renderDeepestMenu are protected methods – is this a BC break? (in the past, it was not)

stefanotorresi pushed a commit to stefanotorresi/zf2 that referenced this pull request Mar 6, 2014
@stefanotorresi
Copy link
Contributor

Well it is debatable for sure, but after all it's protected, not private.
Extended Menu helpers, which are quite common, are now triggering strict standards errors with this patch, and this is a fact. :p

I'll try and work on a fix anyway.

stefanotorresi pushed a commit to stefanotorresi/ZfcTwitterBootstrap that referenced this pull request Mar 10, 2014
mwillbanks pushed a commit to mwillbanks/ZfcTwitterBootstrap that referenced this pull request Nov 23, 2014
weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
…ch-1

Set custom class name for active li element
weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
- trailing whitespace
- s/@return Menu/@return self/ throughout
weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
- including test asset files often results in additional whitespace at
  end of string; updated assertion to trim() first.
weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants