yii2-alerts Displays simple alert message(s) on page

Yii2 Alerts

  1. Installation
  2. Required
  3. Options
  4. Demo
  5. Usage
  6. Comments / Suggestions

Updated: August, 2015

  • Added scss and css files to set your own colors

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-source "c006/yii2-alerts" "dev-master"

or add

"c006/yii2-alerts": "dev-master"

to the require section of your composer.json file.

Required

  • jQuery

  • yii \ widgets \ Bootstrap

Options

message => {string}
Alert message (HTML)

alert_type => {string}

  • Alerts::ALERT_DANGER
  • Alerts::ALERT_WARNING
  • Alerts::ALERT_INFO
  • Alerts::ALERT_SUCCESS

close => {boolean}
Show close link for alert

countdown => {int}
Automatically remove alert in X seconds

Demo

Demo: http://demo.c006.us

Usage

Set message

    Alerts::setMessage('Session Timeout');
    Alerts::setAlertType(Alerts::ALERT_WARNING);
    Alerts::setCountdown(10); /* optional */

Display message <?= Alerts::widget() ?>

Comments / Suggestions

Please provide any helpful feedback or requests.

Thanks.

0 0
1 follower
0 downloads
Yii Version: 2.0
License: MIT
Category: User Interface
Developed by: jchambers
Created on: Aug 21, 2015
Last updated: 2 years ago

Related Extensions