Download the PHP package pentiminax/ux-sweet-alert without Composer
On this page you can find all versions of the php package pentiminax/ux-sweet-alert. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pentiminax/ux-sweet-alert
More information about pentiminax/ux-sweet-alert
Files in pentiminax/ux-sweet-alert
Package ux-sweet-alert
Short Description SweetAlert2 integration for Symfony
License MIT
Homepage https://github.com/pentiminax/ux-sweet-alert
Informations about the package ux-sweet-alert
UX SweetAlert
UX SweetAlert is a Symfony bundle that integrates the SweetAlert2 library into your Symfony applications. It provides PHP helpers, input-type abstractions, Live Components, and a Stimulus controller to display alerts, input dialogs, and toast notifications.
Requirements
- PHP 8.3 or higher
- Symfony StimulusBundle
- Composer
Installation
Install the library via Composer:
Basic usage
To automatically display toasts and alerts in your templates, add the following Twig function in your base.html.twig (or the layout file):
Alerts
Inject the AlertManagerInterface and use the helper methods to create alerts:
Toasts
Use the AlertManagerInterface service with the toast() method to create toast notifications:
Input dialogs
Use AlertManagerInterface::input() with one of the provided input type classes when you want to collect user input from PHP:
Available helpers include Text, Textarea, Select, Radio, Checkbox, File, Range, and HtmlInputType for other native HTML input types.
Live Components
The bundle also ships SweetAlert:ConfirmButton and SweetAlert:InputModal Live Components. Render {{ ux_sweet_alert_scripts() }} on the page, then use the component that matches your interaction pattern. See the online documentation for full examples.
Documentation
All versions of ux-sweet-alert with dependencies
symfony/config Version ^7.0|^8.0
symfony/dependency-injection Version ^7.0|^8.0
symfony/event-dispatcher Version ^7.0|^8.0
symfony/http-kernel Version ^7.0|^8.0
symfony/stimulus-bundle Version ^2.0 | ^3.0
symfony/ux-live-component Version ^2.0 | ^3.0
symfony/ux-twig-component Version ^2.0 | ^3.0
twig/twig Version ^3.8