Underscore as a segment_separators in routing.yml
Posted
by Mickael
on Stack Overflow
See other posts from Stack Overflow
or by Mickael
Published on 2010-05-24T09:02:45Z
Indexed on
2010/05/25
8:01 UTC
Read the original article
Hit count: 290
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 ?
© Stack Overflow or respective owner