diecoding/yii2-toastr Simple flash toastr notifications for Yii2

Yii2 Toastr - Simple flash toastr notifications for Yii2

  1. Cara Memasang
  2. Cara Menggunakan

Latest Version Software License Quality Score Total Downloads

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
3 865 downloads
Yii Version: 2.0
License: BSD-3-Clause
Developed by: Sugeng Sulistiyawan
Created on: Aug 10, 2018
Last updated: 2 years ago
Packagist Profile
Github Repository

Related Extensions