Answer the question
In order to leave comments, you need to log in
How to make normal links?
Good afternoon.
In the settings I wrote:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'news/<id:\d+>/<url:\d+>'=>'news/view',
]
]
<?= Html::a('Название', ['view', 'id' => '3', 'url' => 'statya']) ?>
/news/view?id=8&url=statya
/news/3/statya
/news/3
Answer the question
In order to leave comments, you need to log in
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'news/<id:\d+>/<url:\w+>'=>'news/view',
]
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question