Underscore as a segment_separators in routing.yml
- by Mickael
In symfony project, I would like to use an underscore as a separator
for the parameter in routing.yml.
Url example:
/article/lorem-1111_45.html
In routing.yml
rule_sample:
url: /article/:info-:datePublished_:id.html
param: { module: cms, action: test }
options:
segment_separators: ['-', '/', '.', '_']
requirements:
info: ^([A-Za-z0-9\-]+)$
datePublished: \d+
id: \d+
This code doesnt work. I have the following error:
Unable to parse "/article/:info-:datePublished_:id.html" route near
":id.html".
Anybody knows how to implement this rule ?