terabytesoftw/widget-alert

Bootstrap4 Widget Alert

安装: 157

依赖: 0

建议: 0

安全: 0

星星: 1

观察者: 1

分支: 0

类型:yii2-extension

dev-master / 1.0.x-dev 2019-06-25 13:48 UTC

This package is auto-updated.

Last update: 2023-09-16 01:30:57 UTC


README

68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f443954467731463664645075686544635f74704e707454647654672d464e4e706a4c53424e3134583653632d334a44694f7866453637724568344f5a6679676f6e7831744b656932623244454f48444c6a46365433786c38652d726b4545505a6547714c545763535f76326342526c796f3076635a4c44484735697653444749574373656e626f6c3d7732343030

Bootstrap 4 Widget Alert

Unstable Version Build Status Build Status Build Status Code Quality Code Intelligence Status Maintainability


目录结构:

config/             contains widget configurations
src/                contains source widget file
tests/              contains test codeception

需求:

本扩展至少需要您的Web服务器支持PHP 7.2。

安装:

如果您没有Composer,您可以按照getcomposer.org上的说明进行安装。

然后,您可以使用以下命令安装此项目模板

Linux
php composer.phar require --prefer-dist terabytesoftw/alert "^1.0-dev"
Windows
composer require --prefer-dist terabytesoftw/alert "^1.0-dev"

使用:

警报小部件从会话闪存中渲染消息。所有闪存消息都按setFlash分配的顺序显示。您可以按以下方式设置消息:

闪存消息

68747470733a2f2f6c68332e676f6f676c6575736572636f6e74656e742e636f6d2f53734a583450705f4f734d526769456243532d69464651395f62656834545548667444656b75574e39495a61396c31664f7a514c566656322d636d73505a714d4e30356377344b675432763648345531766e6a585f35444c6b6750696a593367456c6f74485f714e47454e48375a574e766e53774a7246757946696132484b7a484d724e4638456767413d7732343030

Controllers:

$this->module->session->setFlash('primary', 'A simple primary alert—check it out!');

Views:

$this->context->module->session->setFlash('primary', 'A simple primary alert—check it out!');
Controllers:

$this->module->session->setFlash('danger', 'This is the message');
$this->module->session->setFlash('success', 'This is the message');
$this->module->session->setFlash('info', 'This is the message');
$this->module->session->setFlash('light', 'This is the message');
$this->module->session->setFlash('primary', 'This is the message');
$this->module->session->setFlash('secondary', 'This is the message');
$this->module->session->setFlash('success', 'This is the message');
$this->module->session->setFlash('warning', 'This is the message');

Views:

$this->context->module->session->setFlash('danger', 'This is the message');
$this->context->module->session->setFlash('success', 'This is the message');
$this->context->module->session->setFlash('info', 'This is the message');
$this->context->module->session->setFlash('light', 'This is the message');
$this->context->module->session->setFlash('primary', 'This is the message');
$this->context->module->session->setFlash('secondary', 'This is the message');
$this->context->module->session->setFlash('success', 'This is the message');
$this->context->module->session->setFlash('warning', 'This is the message');

可以按如下方式设置多个消息

Controllers:

$this->module->session->setFlash('error', ['Error 1', 'Error 2']);

Views:

$this->context->module->session->setFlash('error', ['Error 1', 'Error 2']);

用法:Layouts\View

use terabytesoft\widgets\Alert;

<?= Alert::widget() ?>

运行测试 Codeception:

// download all composer dependencies root project
$ composer update --prefer-dist -vvv

// run all tests with code coverage
$ vendor/bin/codecept run unit --coverage-xml

Web服务器支持:

  • Apache。
  • Nginx。
  • OpenLiteSpeed。

文档风格指南:

风格 CI 文档 PSR2。

许可证:

License YiiFramework Total Downloads StyleCI