Yii2 Toastr - Simple flash toastr notifications for Yii2 ¶
- Cara Memasang
- Cara Menggunakan
Cara Memasang ¶
composer require --prefer-dist diecoding/yii2-toastr "*"
- Tambahkan pada baris
require
"diecoding/yii2-toastr": "*"
- Kemudian jalankan
composer update
Cara Menggunakan ¶
- Tambahkan di
views\layouts\main.php
\diecoding\toastr\ToastrFlash::widget();
\diecoding\toastr\ToastrFlash::widget([
"hideDuration" => 'custom value',
"timeOut" => 'custom value',
"extendedTimeOut" => 'custom value',
"showEasing" => 'custom value',
"hideEasing" => 'custom value',
"showMethod" => 'custom value',
"hideMethod" => 'custom value',
"tapToDismiss" => 'custom value',
]);
\diecoding\toastr\ToastrFlash::widget([
'options' => [
"closeButton" => 'custom value',
"debug" => 'custom value',
"newestOnTop" => 'custom value',
"progressBar" => 'custom value',
"positionClass" => 'custom value',
"preventDuplicates" => 'custom value',
],
]);
- Set Session Flash
\Yii::$app->session->setFlash('error', 'Message');
\Yii::$app->session->setFlash('error', ['Message 1', 'Message 2', 'Message 3']);
\Yii::$app->session->setFlash('error', [['Title', 'Message']]);
\Yii::$app->session->setFlash('error', [['Title 1', 'Message 1'], ['Title 2', 'Message 2'], ['Title 3', 'Message 3']]);
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.