E
E
EVOSandru62016-04-29 10:20:17
Yii
EVOSandru6, 2016-04-29 10:20:17

What is the rule in Yii1 in UrlManager to add a list of rules so that several get parameters in the method are eaten?

Good afternoon, I did it
like this: www.elisdn.ru/blog/15/dtogglecolumn-kolonka-perekl...
There is an actionToggle($id, $attribute) method for the Services controller.
When you click on the switch button in the grid, the following Url is formed :
salon/smanager/services/toggle/7&attribute=exist
But I catch:
Error 400
Invalid request.

If I change actionToggle($id, $attribute) to actionToggle($id)
And I enter:
salon/smanager/services/toggle/7
Then id clings, but I need both parameters to cling.
Rules in UrlManager :

'/'                                                         =>  'site/index',
        '<action:(login|logout|registration)>'                      =>  'users/<action>',
        '<action:(contact)>'                                        =>  'site/<action>',
        '<controller:\w+>/<id:\d+>'                                 =>  '<controller>/view',
        '<controller:\w+>/<action:\w+>/<id:\d+>'                    =>  '<controller>/<action>',
        '<controller:\w+>/<action:\w+>'                             =>  '<controller>/<action>',
        /** Менеджер */
        '<module:smanager>'                                          =>   '<module>/services/index',
        '<module:smanager>/<controller:\w+>/<id:\d+>'                =>   '<module>/<controller>/view',
        '<module:smanager>/<controller:\w+>'                         =>   '<module>/<controller>/index',
        '<module:smanager>/<controller:\w+>/<action:\w+>/<id:\d+>'   =>   '<module>/<controller>/<action>',
        '<module:smanager>/<controller:\w+>/<action:\w+>'            =>   '<module>/<controller>/<action>',

What needs to be done in order to read the parameters included in the get method ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kim, 2016-05-01
@kimono

Try replacing salon/smanager/services/toggle/7&attribute=existwith salon/smanager/services/toggle/7? attribute=exist. You specify that the ID is an integer, and in the second case, the framework takes the value 7&attribute=existas an integer, and the result is the number 7. And there is no second argument.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question