T
T
torit2018-11-13 20:03:39
Yii
torit, 2018-11-13 20:03:39

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

1 answer(s)
T
torit, 2018-11-14
@torit

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 your question

Ask a Question

731 491 924 answers to any question