N
N
Nicholas2014-08-26 16:45:43
Yii
Nicholas, 2014-08-26 16:45:43

Setting up the UrlManager in Yii so that the path looks like this site.com/controller/?action=action?

I can’t set up the standard CUrlManager in any way so that the paths work:
site.com/controller/?action=action

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-08-26
Sumrak @NikolasSumrak

because the router will only parse '/controller' and will not reach ?action=action. You will have to override CUrlManager.

M
Mikhail Osher, 2014-08-26
@miraage

'urlFormat' => 'path',
'showScriptName' => false,
'rules' => [
    '<controller>/?action=<action>' => '<controller>/<action>'
],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question