branchonline/yii2-sweetalert SweetAlert widget for Yii2

module

SweetAlert Widget for Yii 2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist branchonline/yii2-sweetalert "*"

or add

"branchonline/yii2-sweetalert": "*"

to the require section of your composer.json.

Usage

Once the extension is installed, simply add widget to your page as follows:

1) Default usage, render all flash messages stored in session flash via Yii::$app->session->setFlash().

echo SweetAlert::widget();

2) Custom usage example:

echo SweetAlert::widget([
          'useSessionFlash' => false,
          'options' => [
               'title' => 'Success message',
               'type' => 'Success',
               'text' => "You will not be able to recover this imaginary file!",
               'confirmButtonText'  => "Yes, delete it!",   
               'cancelButtonText' =>  "No, cancel plx!"
          ]
]);

More info

More info about the SweetAlert can be found on options page

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.1 is the latest of 2 releases



Apache-2.0 license
Stats
1 github stars & 1 github forks
0 downloads in the last day
10 downloads in the last 30 days
1475 total downloads