2017 © Pedro PelΓ‘ez
 

yii2-extension yii2-toastr

Simple javascript toast notifications

image

lavrentiev/yii2-toastr

Simple javascript toast notifications

  • Sunday, January 14, 2018
  • by lavrentiev
  • Repository
  • 4 Watchers
  • 17 Stars
  • 13,853 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 5 Forks
  • 4 Open issues
  • 6 Versions
  • 17 % Grown

The README.md

Yii2 - Javascript Toast Notifications

Simple javascript toast notifications - Javascript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended., (*1)

Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Установка

Π Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΠ΅ устанавливаСтся с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ Composer интсрукция ΠΏΠΎ установкС Composer, (*3)

Установка Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΡ Ρ‡Π΅Ρ€Π΅Π· Composer, Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΡƒΡŽ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ:, (*4)

composer require --prefer-dist lavrentiev/yii2-toastr

ΠΈΠ»ΠΈ (master), (*5)

composer require --prefer-dist lavrentiev/yii2-toastr "dev-master"

ΠΈΠ»ΠΈ внСсти измСнСния Π² ΡΠ΅ΠΊΡ†ΠΈΡŽ require Π² composer.json ΠΈ Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚ΡŒ composer update, (*6)

"lavrentiev/yii2-toastr": "^2.0"

ΠΈΠ»ΠΈ (master), (*7)

"lavrentiev/yii2-toastr": "dev-master"

УвСдомлСния Notification::widget()

alt text, (*8)

use lavrentiev\widgets\toastr\Notification;

Notification::widget([
    'type' => 'info',
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'error',
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'success',
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'warning',
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'info',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'error',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'success',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'warning',
    'message' => 'Simple javascript toast notifications'
]);

Π’Π°ΠΊΠΆΠ΅ присутствуСт Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ настройки ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ»ΡŒΠ½ΠΎΠ³ΠΎ увСдомлСния, ΠΏΠΎ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°ΠΌ прСдусмотрСнным Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠ°ΠΌΠΈ Toastr by CodeSeven, (*9)

alt text, (*10)

Notification::widget([
    'type' => Notification::TYPE_ERROR,
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications',
    'options' => [
        "closeButton" => false,
        "debug" => false,
        "newestOnTop" => false,
        "progressBar" => false,
        "positionClass" => Notification::POSITION_TOP_RIGHT,
        "preventDuplicates" => false,
        "onclick" => null,
        "showDuration" => "300",
        "hideDuration" => "1000",
        "timeOut" => "5000",
        "extendedTimeOut" => "1000",
        "showEasing" => "swing",
        "hideEasing" => "linear",
        "showMethod" => "fadeIn",
        "hideMethod" => "fadeOut"
    ]
]);

УвСдомлСния NotificationFlash::widget()

ΠŸΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΎΡΡƒΡ‰Π΅ΡΡ‚Π²Π»ΡΠ΅Ρ‚ΡŒΡΡ глобально допустим Π² layouts ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π°., (*11)

<?= \lavrentiev\widgets\toastr\NotificationFlash::widget() ?>

Π’Π°ΠΊΠΆΠ΅ присутствуСт Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ настройки ΡƒΠ²Π΅Π΄ΠΎΠΌΠ»Π΅Π½ΠΈΠΉ, ΠΏΠΎ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°ΠΌ прСдусмотрСнным Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠ°ΠΌΠΈ Toastr by CodeSeven, (*12)

<?= \lavrentiev\widgets\toastr\NotificationFlash::widget([
    'options' => [
        "closeButton" => true,
        "debug" => false,
        "newestOnTop" => false,
        "progressBar" => false,
        "positionClass" => \lavrentiev\widgets\toastr\NotificationFlash::POSITION_TOP_RIGHT,
        "preventDuplicates" => false,
        "onclick" => null,
        "showDuration" => "300",
        "hideDuration" => "1000",
        "timeOut" => "5000",
        "extendedTimeOut" => "1000",
        "showEasing" => "swing",
        "hideEasing" => "linear",
        "showMethod" => "fadeIn",
        "hideMethod" => "fadeOut"
    ]
]) ?>

alt text, (*13)

\Yii::$app->session->setFlash('error', 'This is the message');
\Yii::$app->session->setFlash('success', 'This is the message');
\Yii::$app->session->setFlash('info', 'This is the message');
\Yii::$app->session->setFlash('warning', 'This is the message');

alt text, (*14)

\Yii::$app->session->setFlash('warning', ['Error 1', 'Error 2', 'Error 3']);
\Yii::$app->session->setFlash('success', ['Error 1', 'Error 2', 'Error 3']);

ДопустимыС ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹

ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ Π—Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ ДопустимыС значСния ОписаниС
type info info, error, success, warning Π’ΠΈΠΏ увСдомлСния
title --- --- Π—Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ увСдомлСния
message Simple javascript toast notifications --- ВСкст увСдомлСния
options [] ΠŸΠΎΠ΄Ρ€ΠΎΠ±Π½Π΅ΠΉ... Π”ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ ΠΎΠΏΡ†ΠΈΠΈ

ДопустимыС константы Ρ‚ΠΈΠΏΠΎΠ²:, (*15)

TYPE_INFO = 'info'
TYPE_ERROR = 'error'
TYPE_SUCCESS = 'success'
TYPE_WARNING = 'warning'

ДопустимыС константы полоТСния:, (*16)

POSITION_TOP_RIGHT = 'toast-top-right';
POSITION_TOP_LEFT = 'toast-top-left';
POSITION_TOP_CENTER = 'toast-top-center';
POSITION_TOP_FULL_WIDTH = 'toast-top-full-width';

POSITION_BOTTOM_RIGHT = 'toast-bottom-right';
POSITION_BOTTOM_LEFT = 'toast-bottom-left';
POSITION_BOTTOM_CENTER = 'toast-bottom-center';
POSITION_BOTTOM_FULL_WIDTH = 'toast-bottom-full-width';

ДСмонстрация

  • Demo can be found at http://codeseven.github.io/toastr/demo.html

Π”ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ

The Versions

14/01 2018

dev-master

9999999-dev https://github.com/lavrentiev/yii2-toastr

Simple javascript toast notifications

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 jquery notification toastr

24/10 2017

2.0.2

2.0.2.0 https://github.com/lavrentiev/yii2-toastr

Simple javascript toast notifications

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 jquery notification toastr

06/12 2016

2.0.1

2.0.1.0 https://github.com/lavrentiev/yii2-toastr

Simple javascript toast notifications

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 jquery notification toastr

05/11 2015

2.0.0

2.0.0.0 https://github.com/lavrentiev/yii2-toastr

Simple javascript toast notifications

  Sources   Download

BSD-3-Clause

The Requires

 

extension yii2 jquery notification toastr

21/04 2015

1.0.1

1.0.1.0 https://github.com/lavrentiev

Simple javascript toast notifications

  Sources   Download

Apache-2.0

The Requires

 

extension yii2 jquery notification toastr

13/04 2015

1.0.0

1.0.0.0 https://github.com/lavrentiev

Simple javascript toast notifications

  Sources   Download

Apache-2.0

The Requires

 

extension yii2 jquery notification toastr