C
C
Caspergreen2018-02-01 14:27:27
Yii
Caspergreen, 2018-02-01 14:27:27

How to correctly form a urlManager rule in yii2?

Good day.
There is an ItemController action view that has a parameter (slug variable)
To get data from the database, a site/item/view?slug=alias request is made How to make a site/about
type rule that will execute the site/item/view?slug=about request ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2018-02-01
@qonand

add rule to rules
'/<slug:\w+>' => 'item/view'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question