In ActiveForm to attach two handlers?

Hello!
This situation, you need to make to one form, two buttons with different functionality.
How to do it? Is it possible to pass buttons get parameter?
For example, the first button to transmit '1' and the second '2'.
July 2nd 19 at 17:41
1 answer
July 2nd 19 at 17:43
Solution
Make 2 button sabmita with different names and in the controller check which one came.
And in what form the controller will receive a name? - Billy.We commented on July 2nd 19 at 17:46
:
var_export(\Yii::$app->request->post());
array (4) [
...
'City' => array (17) [
'name' => string (6) "Moscow"
'active' => string (1) "1"
]
...
'apply' => string (0) ""
]
'apply' just the name of our submission, which is pressed - margarita_Kreiger21 commented on July 2nd 19 at 17:49
: A difficult print_r($_POST) to do? Or just in the debug panel to see how it comes. It's just faster than waiting for a response. - Henderson_Beat commented on July 2nd 19 at 17:52
Thank you) - Billy.We commented on July 2nd 19 at 17:55

Find more questions by tags YiiPHP