All Projects → lavrentiev → yii2-toastr

lavrentiev / yii2-toastr

Licence: other
Yii2 - Javascript Toast Notifications

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to yii2-toastr

yii2-react
Yii2 widget for server-side rendering ReactJs
Stars: ✭ 38 (+52%)
Mutual labels:  yii2, yii2-widget
flasher
A powerful and flexible flash notifications system for PHP
Stars: ✭ 46 (+84%)
Mutual labels:  toastr, notification
Yii2 Slack Log
Pretty Slack log target for Yii 2
Stars: ✭ 24 (-4%)
Mutual labels:  yii2, notification
Vue Toasted
🖖 Responsive Touch Compatible Toast plugin for VueJS 2+
Stars: ✭ 2,091 (+8264%)
Mutual labels:  toastr, notification
yii2-notification-wrapper
Yii2-notification-wrapper module renders a message from session flash (with ajax, pjax support and etc.) through Growl, Noty, Toastr and more libraries
Stars: ✭ 78 (+212%)
Mutual labels:  yii2, toastr
Yii2 Telegram Log
Telegram log target for Yii 2
Stars: ✭ 24 (-4%)
Mutual labels:  yii2, notification
prophetjs
Vanilla JS library to display toast messages.
Stars: ✭ 31 (+24%)
Mutual labels:  toastr, notification
yii2-dingtalk
yii2钉钉接口
Stars: ✭ 23 (-8%)
Mutual labels:  yii2
php-framework-benchmark
php framework benchmark (include laravel、symfony、silex、lumen、slim、yii2、tastphp etc)
Stars: ✭ 17 (-32%)
Mutual labels:  yii2
Sunset-hadith
Islamic app written with Kotlin, using KTOR + coroutines + flow + MVVM + Android Jetpack + Navigation component. Old version using RxJava + Retrofit + OKHttp
Stars: ✭ 26 (+4%)
Mutual labels:  notification
cheatera.pp.ua
cheatera.pp.ua - UNIT Factory students stat: lvl, projects, etc
Stars: ✭ 19 (-24%)
Mutual labels:  yii2
leadshop
Leadshop是一款提供持续更新迭代服务的轻量级、高性能开源电商系统,前后端分离(uniapp +电商专用yii2.0),可视化DIY拖拽装修,旨在打造极致的用户体验! 支持微信小程序,公众号等
Stars: ✭ 168 (+572%)
Mutual labels:  yii2
Tomatobean
集成react + react-router + react-redux的轻量级前端框架。提供keep-live功能,快速构建项目。在构建中大型项目时优势明显。
Stars: ✭ 15 (-40%)
Mutual labels:  notification
memberhive
Relationship Management System for churches and organisations
Stars: ✭ 12 (-52%)
Mutual labels:  yii2
service-skeleton
Microservice skeleton based on yii2 framework.
Stars: ✭ 14 (-44%)
Mutual labels:  yii2
lemon
Lemon – LED Monitor – is a $79.43 opensource alternative to LaMetric that supports GitHub-, IFTTT- and Zapier-webhooks and even integrates with Pushover!
Stars: ✭ 45 (+80%)
Mutual labels:  notification
yii2-league-oauth2-server
Yii 2.0 implementation of PHP league OAuth2 server interfaces
Stars: ✭ 29 (+16%)
Mutual labels:  yii2
vueNotification
Notification plugin for VuesJS
Stars: ✭ 52 (+108%)
Mutual labels:  toastr
yii2-rollbar
Rollbar for Yii2
Stars: ✭ 36 (+44%)
Mutual labels:  yii2
yii2-content-tools
ContentTools editor implementation for Yii 2
Stars: ✭ 79 (+216%)
Mutual labels:  yii2

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.

Latest Stable Version Total Downloads Latest Unstable Version License

Установка

Расширение устанавливается с помощью Composer интсрукция по установке Composer

Установка расширения через Composer, выполнить следующую команду:

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

или (master)

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

или внести изменения в секцию require в composer.json и выполнить composer update

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

или (master)

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

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

alt text

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

alt text

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 проекта.

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

Также присутствует возможность настройки уведомлений, по параметрам предусмотренным разработчиками Toastr by CodeSeven

<?= \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

\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

\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 [] Подробней... Дополнительные опции

Допустимые константы типов:

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

Допустимые константы положения:

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

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

Дополнительно

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].