drexlerux / yii2-bootstrap-sweetalert
Alert widget based on bootstrap-sweetalert extension {@link http://lipis.github.io/bootstrap-sweetalert/)
Package info
github.com/drexlerux/yii2-bootstrap-sweetalert
Type:yii2-extension
pkg:composer/drexlerux/yii2-bootstrap-sweetalert
v1.0.1
2017-09-10 20:11 UTC
Requires
- bower-asset/bootstrap-sweetalert: *
This package is not auto-updated.
Last update: 2026-03-01 11:20:24 UTC
README
- Alert widget based on bootstrap-sweetalert extension http://lipis.github.io/bootstrap-sweetalert
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist drexlerux/yii2-bootstrap-sweetalert "*"
or add
"drexlerux/yii2-bootstrap-sweetalert": "*"
to the require section of your composer.json.
Usage
Once the extension is installed, simply add widget to your page as follows:
echo \drexlerux\sweetalert\SweetAlert::widget([ 'type' => \drexlerux\sweetalert\SweetAlert::TYPE_WARNING, 'options' => [ 'title' => 'Warning message', 'text' => "Do you want to delete it?", 'confirmButtonText' => "Yes, delete it!", 'cancelButtonText' => "No, cancel plx!" ] ]);
Overrid Confirm
SweetAlertAsset overrides javascript confirm dialog by default. If you want to keep default edit your config.php
'assetManager' => [ 'bundles' => [ 'drexlerux\sweetalert\SweetAlertAsset' => [ 'overrideConfirm' => false ] ] ]
Alert Options
You can find them on the options page