D
D
dkrylov2017-04-08 17:58:53
Yii
dkrylov, 2017-04-08 17:58:53

How to configure urlmanager in yii2 to work with static pages that can change?

Hello dear programmers!
I am learning Yii2, one might say at the very beginning of training. Faced this question:
There is a need to dynamically (through the admin panel) create pages for the site. I decided to make a PageController controller, which selects the desired page by alias through the Page model by alias.
Everything would be fine, the pages get. But! How do I configure UrlManager so that access to pages is not /page/about, but just about.
!Pages may change! Therefore, the "/about" => "page/about" option does not work.
Note: this nesting option is also possible - /about/first, /about/second.
Is it possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
padlyuck, 2017-04-08
@dkrylov

https://yiiframework.com.ua/ru/doc/guide/2/runtime...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question