In a symfony project, I would like to use underscore as a separator for a parameter in routing.yml.
Example URL: / 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 does not work. I have the following error: Failed to parse route "/article/:info-:datePublished_:id.html". ": Id.html"
Does anyone know how to implement this rule?
source share