更新时间:2022-04-28 04:54:24
默认情况下禁止使用斜线.您可以通过更改默认要求来启用它们.在您的情况下,***对 id 提出要求,因为它用破折号分隔.
Slashes are by default forbidden. You can enable them by changing the default requirements. In your case it'd be also good to give requirements for the id as it's separated with dash.
请参阅下面的示例.
region:
pattern: /regione/{slug}-{id}
defaults:
_controller: SWAItaliaInCifreBundle:Default:region
requirements:
slug: "[a-zA-Z1-9-_/]+"
id: "d+"