Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question