terabytesoftw / widget-alert
Widget Alert with Bootstrap4
Installs: 157
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- oomphinc/composer-installers-extender: ^1.1
- yiisoft/yii2: ^2.0.20
- yiisoft/yii2-bootstrap4: ^2.0.3
Requires (Dev)
- codeception/c3: 2.*
- codeception/codeception: ^3.0
- hiqdev/composer-config-plugin: ^1.0@dev
- monolog/monolog: *
This package is auto-updated.
Last update: 2023-09-16 01:30:57 UTC
README
Widget Alert with Bootstrap 4
DIRECTORY STRUCTURE:
config/ contains widget configurations
src/ contains source widget file
tests/ contains test codeception
REQUIREMENTS:
The minimum requirement by this extension that your Web server supports PHP 7.2.
INSTALATION:
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install this project template using the following command:
Linux:
php composer.phar require --prefer-dist terabytesoftw/alert "^1.0-dev"
Windows:
composer require --prefer-dist terabytesoftw/alert "^1.0-dev"
USAGE:
Alert widget renders a message from session flash. All flash messages are displayed in the sequence they were assigned using setFlash. You can set message as following:.
Flash Messages:
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');
Multiple messages could be set as follows:
Controllers: $this->module->session->setFlash('error', ['Error 1', 'Error 2']); Views: $this->context->module->session->setFlash('error', ['Error 1', 'Error 2']);
Usages Layouts\View:
use terabytesoft\widgets\Alert; <?= Alert::widget() ?>
RUN TESTS 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 SERVER SUPPORT:
- Apache.
- Nginx.
- OpenLiteSpeed.