mazarini / message-bundle
Display alerts on webpage.
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.1
- ext-ctype: *
- ext-iconv: *
- symfony/console: ^6.3|^7.0
- symfony/framework-bundle: ^6.3|^7.0
- symfony/runtime: ^6.3|^7.0
- symfony/twig-bundle: ^6.3|^7.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/browser-kit: ^6.3|^7.0
- symfony/css-selector: ^6.3|^7.0
- symfony/dotenv: ^6.3|^7.0
- symfony/flex: ^2.4
- symfony/maker-bundle: ^1.50
- symfony/phpunit-bridge: ^6.3|^7.0
- symfony/yaml: ^6.3|^7.0
This package is auto-updated.
Last update: 2024-11-19 23:36:02 UTC
README
Display alerts on webpage for symfony using alert from bootstrap.
Installation
foo@bar:~$ composer require mazarini/message-bundle
Add alerts with twig
In template/base.html.twig :
{% include('@MazariniMessage/_messages.html.twig') %}
Display alerts in create order
In each controller :
<?php ... use Mazarini\MessageBundle\Controller\MessageControllerTrait; ... class HomeController extends AbstractController { use MessageControllerTrait; ... }
Default configuration
foo@bar:~$ symfony console debug:config MazariniMessageBundle Current configuration for "MazariniMessageBundle" ================================================= mazarini_message: default: alert-danger types: primary: alert-primary secondary: alert-secondary success: alert-success danger: alert-danger error: alert-danger warning: alert-warning info: alert-info light: alert-light dark: alert-dark foo@bar:~$
"types" is use to translate type of messages to class of alerts. By default, bootstrap classes are defines but other can be use.