PHP code example of drexlerux / yii2-bootstrap-sweetalert

1. Go to this page and download the library: Download drexlerux/yii2-bootstrap-sweetalert library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

drexlerux / yii2-bootstrap-sweetalert example snippets


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!"
        ]
]);

'assetManager' => [
    'bundles' => [
        'drexlerux\sweetalert\SweetAlertAsset' => [
            'overrideConfirm' => false
        ]
    ]
]

php composer.phar