Navigation Menu

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

Add isActive method Navigation Page Uri. #4348

Closed
wants to merge 14 commits into from

Conversation

tomshaw
Copy link
Contributor

@tomshaw tomshaw commented Apr 28, 2013

This PR adds active links to Zend Navigation pages generated using the uri container key. This is an attempt to fix #4346

@DASPRiD
Copy link
Member

DASPRiD commented Apr 28, 2013

  1. Why injecting the router, when injecting the request object is enough?
  2. The URI navigation page can not just contain a path, but query parameters, hostname, scheme and such as well. Those should be taken into account.

@tomshaw
Copy link
Contributor Author

tomshaw commented Apr 28, 2013

I like the idea of using the request object, the router was already available thats why I used it. How would you match the active route with only the uri string to go by, that was the dilemma i had trying to make the active route active css wise. The router its so much more definitive than a uri string but the above works for simple use cases.

@froschdesign
Copy link
Member

@tomshaw

  1. I think, we should only have a "soft" dependency to other ZF components for the page type "URI". So that the Zend\Navigation component can also be used outside of a ZF-MVC application.
  2. A "soft" dependency to the request object is enough.
  3. Please do not forgot unit tests.
  4. Thanks! 😄

@weierophinney
Copy link
Member

I agree with @DASPRiD and @froschdesign here. If you can make the changes in the by Tuesday at noon GMT, I'll consider them for 2.2.0; otherwise, we'll have to delay them to 2.3.0.

@tomshaw
Copy link
Contributor Author

tomshaw commented Apr 29, 2013

Awesome! I'm not an expert with phpunit but I'll try my best. :)

@froschdesign
Copy link
Member

Please add one clean commit! There are to many forward and backward steps in your commits.

weierophinney added a commit that referenced this pull request May 22, 2013
Add isActive method Navigation Page Uri.
weierophinney added a commit that referenced this pull request May 22, 2013
- Only inject request if it is an HTTP request
- Allow injecting a null value for request in URI page type
weierophinney added a commit that referenced this pull request May 22, 2013
- indentation
- trailing whitespace
weierophinney added a commit that referenced this pull request May 22, 2013
@ghost ghost assigned weierophinney May 22, 2013
@weierophinney
Copy link
Member

Merged to develop for release in 2.3.0.

weierophinney added a commit to zendframework/zend-navigation that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-navigation that referenced this pull request May 15, 2015
- Only inject request if it is an HTTP request
- Allow injecting a null value for request in URI page type
weierophinney added a commit to zendframework/zend-navigation that referenced this pull request May 15, 2015
- indentation
- trailing whitespace
weierophinney added a commit to zendframework/zend-navigation 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.

Zend Navigation Page Uri Missing isActive Method.
4 participants