承接 dominus77/yii2-noty 相关项目开发

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

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

dominus77/yii2-noty

最新稳定版本:v1.0.5

Composer 安装命令:

composer require dominus77/yii2-noty

包简介

Renders a Noty3 widget for Yii2.

README 文档

README

Latest Version Software License Build Status codecov Scrutinizer Code Quality SymfonyInsight

Noty widget for Yii2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require dominus77/yii2-noty

or add

"dominus77/yii2-noty": "^1.0"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your layout file like this:

Controller:

<?php
// ...
Yii::$app->session->setFlash(\dominus77\noty\NotyWidget::TYPE_SUCCESS, 'Hello World!');
// ...

also

<?php
// ...
Yii::$app->session->setFlash('key1', [
    \dominus77\noty\NotyWidget::TYPE_SUCCESS,
    'Hello World!', 
    // Type options
    [
        'timeout' => 3000
    ],
    // Options
    [
        'progressBar' => true,
        'layout' => \dominus77\noty\NotyWidget::LAYOUT_TOP_RIGHT,
        'theme' => \dominus77\noty\NotyWidget::THEME_MINT
    ]
]);
// ...

View:

<?php
use dominus77\noty\NotyWidget;
?>

<?php NotyWidget::widget(); ?>

also

<?php
use dominus77\noty\NotyWidget;
?>

<?php NotyWidget::widget([
    'typeOptions' => [
        NotyWidget::TYPE_SUCCESS => ['timeout' => 3000],
        NotyWidget::TYPE_INFO => ['timeout' => 3000],
        NotyWidget::TYPE_ALERT => ['timeout' => 3000],
        NotyWidget::TYPE_ERROR => ['timeout' => 5000],
        NotyWidget::TYPE_WARNING => ['timeout' => 3000]
    ],
    'options' => [
        'progressBar' => true,
        'timeout' => false,
        'layout' => NotyWidget::LAYOUT_TOP_CENTER,
        'dismissQueue' => true,
        'theme' => NotyWidget::THEME_SUNSET
    ],
]); ?>

More Information

Please, check the Noty

Testing

$ vendor/bin/phpunit

License

The MIT License (MIT). Please see License File for more information.

SymfonyInsight

SymfonyInsight

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

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