diecoding/yii2-toastr

Simple flash toastr notifications for Yii2

Installs: 3 679

Dependents: 1

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 0

Open Issues: 1

Type:yii2-widget

v1.0.5 2020-03-04 01:03 UTC

This package is auto-updated.

Last update: 2020-11-04 02:52:30 UTC


README

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']]);