Page 1 of 1

Core parameters in Symfony routes

Posted: 14 Jan 2015, 17:00
by garwat82
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

Re: Core parameters in Symfony routes

Posted: 14 Jan 2015, 17:25
by aimeos
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?

Re: Core parameters in Symfony routes

Posted: 14 Jan 2015, 17:35
by garwat82
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?

Re: Core parameters in Symfony routes

Posted: 14 Jan 2015, 17:54
by aimeos
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

Posted: 14 Jan 2015, 18:09
by garwat82
OK, I will care about this and get back to you when its done.

Garret

Re: Core parameters in Symfony routes

Posted: 15 Jan 2015, 21:55
by garwat82
Hey folks

The necessary changes are done and the tests succeed: https://github.com/aimeos/arcavias-core/pull/4

Regards,

Garret