diecoding/yii2-toastr Simple flash toastr notifications for Yii2

Yii2 Toastr - Simple flash toastr notifications for Yii2

  1. Cara Memasang
  2. Cara Menggunakan

Cara Memasang

  • Melalui console
composer require --prefer-dist diecoding/yii2-toastr "*"
  • Melalui composer.json
  1. Tambahkan pada baris require
"diecoding/yii2-toastr": "*"
  1. Kemudian jalankan
composer update

Cara Menggunakan

  1. Tambahkan di views\layouts\main.php
\diecoding\toastr\ToastrFlash::widget();

// custom
\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',
]);

// or
\diecoding\toastr\ToastrFlash::widget([
    'options' => [
        "closeButton"       => 'custom value',
        "debug"             => 'custom value',
        "newestOnTop"       => 'custom value',
        "progressBar"       => 'custom value',
        "positionClass"     => 'custom value',
        "preventDuplicates" => 'custom value',
    ],
]);
  1. Set Session Flash
    • Cara Basic
\Yii::$app->session->setFlash('error', 'Message');

\Yii::$app->session->setFlash('error', ['Message 1', 'Message 2', 'Message 3']);
  • Cara Advanced
\Yii::$app->session->setFlash('error', [['Title', 'Message']]);

\Yii::$app->session->setFlash('error', [['Title 1', 'Message 1'], ['Title 2', 'Message 2'], ['Title 3', 'Message 3']]);
2 0
1 follower
175 downloads
Yii Version: 2.0
License: MIT
Developed by: Sugeng Sulistiyawan
Created on: Aug 10, 2018
Last updated: 2 months ago
Packagist Profile
Github Repository

Related Extensions