BackgroundSync Form
Installation
{
"controllers": {
"@spomky-labs/pwa-bundle": {
"backgroundsync-form": {
"enabled": true
}
}
}
}Usage
<form {{ stimulus_controller('pwa/backgroundsync-form', {
redirection: path('app_contact_success'),
headers: { 'X-Requested-With': 'XMLHttpRequest' },
}) }}
action="{{ path('app_contact_submit') }}"
method="POST"
{{ stimulus_action('pwa/backgroundsync-form', 'send', 'submit') }}
>
<input type="text" name="name" required>
<input type="email" name="email" required>
<textarea name="message" required></textarea>
<button type="submit">Send</button>
</form>Parameters
Parameter
Type
Default
Description
Actions
Action
Description
Events
Event
Detail
Description
Supported Content Types
How It Works
Example: Contact Form with Offline Support
Example: JSON API Form
Related Documentation
Last updated
Was this helpful?