承接 floor12/yii2-notification 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

floor12/yii2-notification

最新稳定版本:1.3.4

Composer 安装命令:

composer require floor12/yii2-notification

包简介

Simple but useful JS notification script with PHP Api.

README 文档

README

Latest Stable Version Scrutinizer Code Quality Latest Unstable Version Total Downloads License

Этот файл так же доступен на русском языке.

This simple extension helps to show nice notifications in browser. It use svg icons and can be customised by overwriting base CSS styles.

Image

Installation

Just run:

$ composer require floor12/yii2-notification

or add this to the require section of your composer.json.

"floor12/yii2-notification": "dev-master"

To include js and css files, add floor12\notification\NotificationAsset as dependency in your AppAsset:

use floor12\notification\NotificationAsset;
use yii\web\AssetBundle;

class AppAsset extends AssetBundle
{
    ...
    public $depends = [
        NotificationAsset::class
    ];
}

Using as JS

To show notification in browser just pass message text to one of the f12notification object methods:

f12notification.info(text);    //information message;
f12notification.success(text); //success message;
f12notification.error(text);   //error message;

For example:

if (userSucces == true)
  f12notification.success('Registration success'.)
else
  f12notification.error('Registration failed.')

Using as PHP

Its also possible to show notifications by passing message text to one of the floor12\notification\Notification methods:

use floor12\notification\Notification;

Notification::info('The form is loading...');
Notification::error('Pleas fill all required fields');
Notification::success('This model is saved');

In case if using PHP api, NotificationAsset will be included in your app by Notification class.

统计信息

  • 总下载量: 14.79k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-24