Answer the question
In order to leave comments, you need to log in
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>',
Answer the question
In order to leave comments, you need to log in
Try replacing salon/smanager/services/toggle/7&attribute=exist
with 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=exist
as 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 questionAsk a Question
731 491 924 answers to any question