Yii urlManager rule parametr with slash

389 views Asked by At

I have controller CategoryController that should to process url kind of

http://example.com/category/param/paramnext/paramsome...

My config includes the next code:

        'urlManager'=>array(
            'urlFormat'=>'path',
            'rules'=>array(
               'category/<name:[\w\/]+>'=>'category/view',

                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            ),
            'showScriptName'=>false,
        ),

But this is not works!

Error 404 The system is unable to find the requested action "param".

How I can to resolve this restriction?

I would be to have something kind of $name with string "param/paramnext/paramsome..."

1

There are 1 answers

0
Sundved On BEST ANSWER
'category/<name:[\w_\/-]+>'=>'category/view',

That's right answer. Question can be closed.