I have two forms with two submit buttons in one page, one view and one controller should manage them. I want it to perform one action if the first one is clicked, and another action - if the second. I tried this where edit is the name of the form but it doesn't work:
if($this->getRequest()->get('edit'))
I also tried setting value to the submit buttons but I could't make it go, too. Please help me to find a way how to identify which button was pressed. :)
Symfony 2.3 comes with the solution. It supports buttons in forms, and you have isClicked() method to check if a button was clicked.
http://symfony.com/blog/new-in-symfony-2-3-buttons-support-in-forms
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With