T
T
ThreegunD2017-06-22 16:36:54
Yii
ThreegunD, 2017-06-22 16:36:54

Correct setting of url-manager yii1?

There is a rule like

'<controller:\w+>/<action:\w+>/<id:\w+>/maincategory/<maincategory:\w+>'=>'<controller>/<action>',

When following a link like
http://parsercsv.loc/model/model/fusion_24/maincategory/vyhlopnaya-sistema_55

Controller Model actionModel method Printing
the $_GET array prints
Array ( [fusion_24] => maincategory [vyhlopnaya-sistema_55] => )
Должно быть 
Array ( [id] =>fusion_24 [maincategory] =>vyhlopnaya-sistema_55)

Has anyone encountered such a thing? And how is it decided?
advanced yii version 1.1.16
Full set of url rules
'indetail/id/<id:\d+>' => 'income/detail',
                    'redemption/search/<search:\d+>' => 'redemption/index',
                    'success/<success:\d+>' => 'site/index',
                    'error/<error:\w+>' => 'site/index',
                    'redemption/error/<error:\w+>' => 'redemption/index',
                    'success/<success:\d+>/code/<code:\w+>' => 'site/index',
                    '<controller:\w+>/<action:\w+>/<id:\w+>/add/<add:\d+>'=>'<controller>/<action>',
                    '<controller:\w+>/<action:\w+>/<id:\w+>/category/<category:\w+>'=>'<controller>/<action>',
                    '<controller:\w+>/<action:\w+>/<id:\w+>/maincategory/<maincategory:\w+>'=>'<controller>/<action>',
                    '<controller:\w+>/<action:\w+>/<id:\w+>'=>'<controller>/<action>',
                    '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vyachin, 2017-07-25
@ThreegunD

'<controller:\w+>/<action:\w+>/<id:[\w_]+>/maincategory/<maincategory:\w+>'=>'<controller>/<action>',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question