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
DynamicRouter can't be used exactly like ChainedRouter #151
Comments
applications should only use what the RouterInterface or the UrlMatcherInterface / RequestMatcherInterface provides. what exactly is the problem? either its a bug of DynamicRouter or ChainedRouter is cleaning up something wobbly that you are doing, so more hiding a problem you already have. |
So if you use DynamicRouter directly but your matcher is NestedMatcher it just doesn't work, its a bit sad that DynamicRouter does not also provide the wrapping like ChainedRouter does |
do you use match or matchRequest? the preferred way to use any of the
routers is to use matchRequest, to prevent information loss. anything
but the URL has to be made up out of thin air with match()
|
HI. Well, for normal routing we use ::matchRequest() which works perfect. For some internal validation of user entered path we used to use ::match() but I think its fine to just replace that single call |
See https://www.drupal.org/files/issues/2576809-11.patch for the adaptions which needed to be made |
if i read that diff correctly, the only change related to the different behaviour is this:
this seems not too heavy to me. the rest is having to do with assumptions and the different interfaces that may or may not be implemented when you want to be generic.
this is missing a return i think. i don't know the context but i wonder why you do not require a RouterInterface to be injected if you want to decorate a router.
|
btw, also not #147 and #152 where people want to change how the ChainRouter match vs matchRequest behaves. and even more related things, there is the idea to only have a matchRequest method in symfony 3: symfony/symfony#9781 |
instead of throwing an exception if we do not have an |
Yeah that would be a little bit more convient. Not sure what you think: So On Thu, Oct 8, 2015 at 11:45 AM, Lukas Kahwe Smith <notifications@github.com
|
we might be able to solve this via symfony/symfony#16346 /cc @Tobion @lolautruche |
@dawehner ok for you if you simply do the Request::create for now and we close this issue? the next major version of this library will hopefully drop the |
Yeah sure, Drupal will find workarounds, this is for sure |
Given the architecture I'd expect that you could switch off ChainedRouter without having any problem,
but it turns out, you require it for ->match() calls
The text was updated successfully, but these errors were encountered: