Core parameters in Symfony routes
Forum rules
Always add your Symfony, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Symfony, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Core parameters in Symfony routes
Hi there
Tried to make some parameters like "d-product-id" part of the Symfony route, e.g. "/detail/{d-product-id}" but that doesn't work as Symfony allows only word characters and no dashes for the placeholders. I'm thinking about converting dashes to underscores somewhere but this may collide if a parameter name will contain an underscore in the future. Are there any other feasable options?
Regards,
Garret
Tried to make some parameters like "d-product-id" part of the Symfony route, e.g. "/detail/{d-product-id}" but that doesn't work as Symfony allows only word characters and no dashes for the placeholders. I'm thinking about converting dashes to underscores somewhere but this may collide if a parameter name will contain an underscore in the future. Are there any other feasable options?
Regards,
Garret
Last edited by garwat82 on 14 Jan 2015, 18:10, edited 1 time in total.
Re: Core parameters in Symfony routes
Hi Garret
This seems to be a bigger problem and converting the dashes to underscores forth and back in the bundle isn't a viable solution as you've already noted. Is there no way to patch Symfony to allow dashes in parameter names?
This seems to be a bigger problem and converting the dashes to underscores forth and back in the bundle isn't a viable solution as you've already noted. Is there no way to patch Symfony to allow dashes in parameter names?
Re: Core parameters in Symfony routes
I did some research and asked the Symfony developers yesterday and both was negative. The Symfony developers wouldn't do this either as it will complicate things a lot for them (see https://github.com/symfony/symfony/issues/13400). They suggested to do this in the bundle and I fear this isn't a great solution too.
The only way to get a compatible and good solution seems to be changing the parameter names in the core to "d_product_id" and maybe shorten the name in the same step to e.g. "d_prodid". What do you think?
The only way to get a compatible and good solution seems to be changing the parameter names in the core to "d_product_id" and maybe shorten the name in the same step to e.g. "d_prodid". What do you think?
Re: Core parameters in Symfony routes
I see and I'm always hesitating making incompatible changes to the core. But if this is the only good option we have then do it ...
Re: Core parameters in Symfony routes
OK, I will care about this and get back to you when its done.
Garret
Garret
Re: Core parameters in Symfony routes
Hey folks
The necessary changes are done and the tests succeed: https://github.com/aimeos/arcavias-core/pull/4
Regards,
Garret
The necessary changes are done and the tests succeed: https://github.com/aimeos/arcavias-core/pull/4
Regards,
Garret