Mary
Mary

Reputation: 37

yii2 UrlManager error with last element in url

How can I set up urlManager rules like that?

Yii perceives the last element as a category. I need exactly this scheme url. If you do not put the last slash, then everything is OK, but it is needed

Now i have this rules

 'blog/<category:[\w_\/-]+>' => 'blog/category',
 'blog/<category:[\w_\/-]+>/<slug>' => 'blog/post',

they do not work. There is an option to parse url and run needed action in controller, but its wrong

Upvotes: 0

Views: 51

Answers (0)

Related Questions