xililo / flash-popup-widget
A widget that displays session flashes and triggers popups
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:CSS
Type:yii2-widget
Requires
- yiisoft/yii2: ^2.0
This package is auto-updated.
Last update: 2024-05-20 03:08:21 UTC
README
FlashPopupWidget is a Yii2 widget that displays session flashes as popups based on the flash types.
Installation
Install the widget using Composer:
composer require xililo/flash-popup-widget
Usage
Let's say you have the folowing in the controller:
Yii::$app->session->addFlash('danger', 'Log in to proceed with the operation.');
Import the FlashPopupWidget class at the top of your main layout view or any view file (e.g. in your views/layouts/main.php
):
use xililo\Popups\FlashPopupWidget;
Place the widget call in your view file or controller where you want to display the flashes and trigger the popups:
echo FlashPopupWidget::widget();
This will render the FlashPopupWidget popups based on the flash types.