S
S
Sergey2015-06-08 21:19:26
Yii
Sergey, 2015-06-08 21:19:26

how to make url in yii?

there is a prodaja module,
respectively, it is displayed on the prodaja website, but I need prodaja-kvartir
What should I write in the index action or in the config?
This option doesn't work:

'urlManager'=> [
..............
'rules'=> [
.............
'prodaja-kvartir/<_c:\w+>/<_a:\w+>' => 'prodaja/<_c>/<_a>',
..............
],
],

Or maybe do it better?
Hide prodaja
and add link in index action

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cloud_zurbag, 2015-06-11
@cloud_zurbag

Well, in general, this is how it works for me (yii2)

rules => array(
   'news' =>  'newsmodules/news/index'
   'news/<_c>' =>  'newsmodules/<_c>/index'
   'news/<_c>/<_a>' =>  'newsmodules/<_c>/<_a>'
),

urls:
inner.site/news -> newsmodules/news/index
inner.site/news/image ->newsmodules/news/image/index
inner.site/news/image/upload -> newsmodule/news/image/upload

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question