Categories
How to generate urlManager rule in yii2?
How to form a rule in yii2. What you need to get - mysite.com/id15 What you have - mysite.com/page?page_id=15 (mysite.com/page/15)
Answer the question
In order to leave comments, you need to log in
a rule was added to the web.php file: the link is formed like this:
<?=\yii\helpers\Url::to(['site/page', 'page_id' => $page_id])?>
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question