Forms are an integral part of web application. Add
foa/filter-input-bundle to your
composer.json and install the dependencies.
Inorder to create a form, we need to extend the
Aura\Input\Form class and override the
An example is shown below.
Note : We are using v1 components of input, intl, filter.
If you have type hinted in the constructor where you need
App\Input\ContactForm the di is smart enough to inject the dependencies.
You can also do as below
Form can be populated using
In aura term it will be $this->request->post->get()
Validating User Input
You can validate the form via the
Assuming you have passed the
ContactForm object, and the variable assigned is
contact_form you can use the
get method on the form object to get the hints of field, and pass to input helper.
An example is given below :