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

Routing configuration extraction #97

Merged
merged 2 commits into from
Jun 14, 2017
Merged

Routing configuration extraction #97

merged 2 commits into from
Jun 14, 2017

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Jun 12, 2017

Q A
License MIT

@javiereguiluz
Copy link
Member

I've never cared or changed or configured this router.strict_requirements option. Is this something still used/needed? Because I need something like this for Twig extensions (e.g. generating the logout URL can throw an exception and that's bad) but I've never need it for generating routes.

@fabpot fabpot merged commit a1b5be2 into master Jun 14, 2017
@fabpot fabpot deleted the router-extract branch June 14, 2017 23:32
@sstok
Copy link
Contributor

sstok commented Jun 15, 2017

Strict requirements are about generating, when you generate an URL the parameters for that URL must match it's requirements, else you will never be able reach that URL.

https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Routing/Generator/UrlGenerator.php#L156-L181

The configuration name a bit unclear, and I actually had to check the source code to verify what I remembered :)

@javiereguiluz
Copy link
Member

@sstok yes ... but let me put you an example. Imagine that your route has a page param that requires integers and you pass a as the value. If this option ignores the requirements and lets you generate a URL like ....?page=a that might briefly work in the template, but it will generate a big exception in the backend.

In summary ... this option looks to me like an illusion. It helps you believe that things will work ... but the generated URLs will probably be wrong and will generate exceptions short after.

@fabpot
Copy link
Member Author

fabpot commented Jun 15, 2017

That's a good discussion to have, but on symfony/symfony :) This was introduced by Jordi IIRC.

VolCh pushed a commit to VolCh/recipes that referenced this pull request Nov 30, 2017
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.

5 participants