I have created an abstract form class that adds a submit element to the form. When my other form classes extend this form class I am having to call parent::__construct() at the bottom of the class so that the submit element is added last.
How do I set the submit button to always be the last element in the form, event if I call parent::__construct() first?
The form
addfunction accepts two parameters - either an array or element instance, and an array offlags. One of the flag options ispriority. The smaller the number, the lower in the list of elements it will appear. Therefore, setting it to -1000 (unless you have greater than 1000 elements) will set the submit button to appear at the bottom of the form: