Answer the question
In order to leave comments, you need to log in
How to set up the CNC correctly with the Get parameter?
Good day to all.
It is necessary to bring such a link
to mind. I have already read the documentation a hundred times,
googled
it, but I just can’t understand, the rest of the rules all work, but this one doesn’t:http://site.dev/search/?name=Ivanod
http://site.dev/search/Ivanod
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'suffix' => '/',
'normalizer' => [
'class' => 'yii\web\UrlNormalizer',
// use temporary redirection instead of permanent for debugging
'action' => UrlNormalizer::ACTION_REDIRECT_TEMPORARY,
'normalizeTrailingSlash' => true
]
'rules' => ['/search/<brand_name:.+>' => 'site/search']
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Here is a link to the official documentation . Just about CNC. Study the section and not only this one, but also others.
And the urlManager rules with a parameter might look like this:
rules => [
'<_c:[\w]+>/<_a:[\w]+>/<id:\d+>' => '<_c>/view'
]
I don’t know about this issue, but I saw https://habrahabr.ru/post/42172/
Read it yourself already))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question