L
L
lilwings2020-01-08 11:57:28
Yii
lilwings, 2020-01-08 11:57:28

Yii2 urlManager not working link with `-`?

Hello everyone!)
Here are the urlManager settings:

'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [
        'info/<url:\w+>' => 'site/info'
    ],
],

Works: /info/slugName
Doesn't work: /info/slug-name
Doesn't want to work because of `-`((

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2020-01-08
@lilwings

[\w\-]+

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question