W
W
WingRS2017-05-10 23:14:16
Yii
WingRS, 2017-05-10 23:14:16

How to render page by slug in yii2?

I want to render a post based on a title that was previously transliterated (slug).
Added actionName($slug) which renders by criteria, but how to remove action name from path via urlmanager?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RustemS, 2017-05-12
@WingRS

If PostController instead of (Name) write (Post)
Create only actionView($slug)

'<controller:(Name)>/<slug>' => '<controller>/view',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question