I'm trying to make a route parameter match an alphanumeric value that's 3 to 15 characters long. Code looks like this:
TestBundle_new:
pattern: /message/new/{name}
defaults: { _controller: TestBundle:Message:new }
requirements:
name: [a-zA-Z0-9]{2,15}
Unfortunately routing.yml fails to load. I was wondering if there is anything I can do to make this work?
You need to add quotes around your pattern.
name: "[a-zA-Z0-9]{2,15}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With