Conversation
|
That's nice. I thought about adding such shortcuts a few years ago, but never did it. What about adding this support in the Symfony Routing component instead? We could then add more than just UUID. |
|
Thank you. I would be happy to make a PR to the routing component. I was not sure if you would accept it there. I'll try to create that PR today. |
|
The core team did not accept my change. It was too much of a hack. However, @lyrixx provided a neat alternative solution. Do we want to merge this PR or should I update the documentation with the alternative solution? |
|
@Nyholm FYI, @javiereguiluz started a PR on the docs repo: symfony/symfony-docs#6505 |
|
If this is added to the Route annotation, it will become quite unclear what the differences are between the symfony route and this extension. As it is, I actually rather see this service removed and make a Controller annotation instead due to this confusion. |
|
I think support for this does not belong to this bundle but to Symfony core. As it has been rejected there, I'm closing this PR. |
I use an uuid (v4) in my URL to identify an entity (like you always should). This is a recommended security measure if you compare with just using an auto incremental numeric id (which is standard for a Doctrine/Mysql setup). I want of course make sure that my routes are properly defined and that I have a
requirementon all my variables. So I write something like this:The regex for the uuid is quite long and horrible to write/remember. This PR allows you to write a shortcut for that ugly regex. So instead you would write: