I have 2 separate controllers Controller1:somethingActionand Controller2:processForm.
As somethingActionI create a form and set its action (url) in the processFormurl. When a form is displayed in the view somethingAction, the POST data goes to processForm.
In processFormI create the same form, validate it and process it. Everything works fine, except when the form is invalid. Since in order to show errors, as well as user input, you will need to display exactly the same view as somethingAction.
It seems to me that I cannot reuse such forms without copying the code (part of the process form), even if it is 3-4 lines, I would expect such functionality to exist.
Is there an easy way to do this? Without AJAX. Did I miss something?
This can be done if the embed controllers can redirect.
source
share