Easy to use AJAX forms written to handle symfony form errors.
Enable symfony-form plugin and add connector:
import symfonyForm from 'vue-symfony-form';
import connector from 'vue-symfony-form/src/core/connector';
Vue.use(symfonyForm, {
connector: connector
});
Connector is a driver responsible for sending messages. You can replace it with your own.
Create new form with symfony-form
component with required action
attribute.
Following code will send simple GET
request to action
url:
<symfony-form action="/foo">
<input type="text" name="name" />
<input type="email" name="email" />
<button>Send</button>
</symfony-form>
When form will be proceeded you'll get appropriate errors above fields in case your form data isn't valid.
That's all.
Action procceeded before data will be sent.
Action in case of success status
Action in case of invalid data
Action procceeded when request completely sent
Request method ('GET' by default)
Class which will be performed to error divs
Set unify data prefix for input fields. [dataPrefix][name]
Just a flag to use in connector. You can modify connector and set extra headers for authorized requests
Use it to modify default error message in case of request was failed