nixar59/yii2-bs4-alert

Contains widget class for display alerts in views and add it from controllers.

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 1

Type:yii2-extension

dev-master 2019-08-10 11:08 UTC

This package is auto-updated.

Last update: 2024-05-16 03:22:52 UTC


README

Contains widget class for display alerts in views and add it from controllers.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist nixar59/yii2-bs4-alert "*"

or add

"nixar59/yii2-bs4-alert": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your view to display alerts :

<?= \nixar59\alert\Alert::widget(); ?>

To add alerts use static methods :

<?php 

use nixar59\alert\Alert;

// .alert-primary
Alert::primary('Primary message.');
// .alert-secondary
Alert::secondary('Secondary message.');
// .alert-success
Alert::success('Success message.');
// .alert-danger
Alert::danger('Danger message.');
// .alert-warning
Alert::warning('Warning message.');
// .alert-info
Alert::info('Info message.');
// .alert-light
Alert::light('Light message.');
// .alert-danger
Alert::dark('Dark message.');

?>

See also