In ZF2, I have the controller factory that instantiates the controller. The controller displays and processes 6 forms. The forms share the same name
of the submit button, but have different submit value
s.
The forms get processed in the controllers indexAction()
using multiple if-elseif
s based on the value of the form's submit button.
I'd like to get rid of if-elseif
s. I guess I need to use the strategy design pattern on the controller's factory class. Problem is that I somehow need to pass the value of the submit button into the controller factory.
How can I do this?