Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force UrlComparerTrait::_normalize to use GET method #180

Open
wants to merge 1 commit into
base: 4.0.1-alpha
Choose a base branch
from

Conversation

Erwane
Copy link
Collaborator

@Erwane Erwane commented Jul 9, 2019

No description provided.

@Erwane Erwane changed the title force UrlComparerTrait::_normalize to use GET method #179 - force UrlComparerTrait::_normalize to use GET method Jul 9, 2019
@Erwane Erwane changed the title #179 - force UrlComparerTrait::_normalize to use GET method force UrlComparerTrait::_normalize to use GET method Jul 9, 2019
@Erwane
Copy link
Collaborator Author

Erwane commented Jul 9, 2019

for issue #179

@Holt59
Copy link
Collaborator

Holt59 commented Jul 9, 2019

Thanks for the PR. Isn't this going to break the opposite case, i.e., if you have a POST URL and you are on a GET one?

@Erwane
Copy link
Collaborator Author

Erwane commented Jul 9, 2019

There is no reason a POST only route need UrlComparerTrait for navlinks i thinks.

Maybe in case of ajax url in data-url attribute ...

Another option is to parse RouteCollection and check url only for route allow current method ?

@Holt59
Copy link
Collaborator

Holt59 commented Jul 9, 2019

I agree with you regarding POST only links in a navigation bar but I would like the UrlComparatorTrait to not be navbar-specific.

Honestly, I don't know why CakePHP has such behaviour... ServerRequest is probably not the right tool for this job, but I have a hard time getting something clean... Comparing CakePHP urls is getting me crazy, this trait was meant to be a small utility tool but it is now probably the most complicated part of the whole helper set.

@Erwane
Copy link
Collaborator Author

Erwane commented Oct 15, 2019

Hi.
What we need to advance on this PR ?

@Holt59
Copy link
Collaborator

Holt59 commented Oct 16, 2019

@Erwane A possibility would be to let user specify the method used to compare, with a default to no-method in the UrlComparerTrait (current behavior), but a default to GET in the navbar helper.

This would be retro-compatible, and more flexible for future changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants