Code Monkey home page Code Monkey logo

yii2-widget-alert's Introduction

Krajee Logo
yii2-widget-alert
Donate       kartikv

Stable Version Unstable Version License Total Downloads Monthly Downloads Daily Downloads

This extension contains a couple of useful widgets. The Alert widget extends the \yii\bootstrap\Alert widget with more easy styling and auto fade out options. In addition, it includes a AlertBlock widget that groups multiple \kartik\widget\Alert or kartik\widget\Growl widgets in one single block and renders them stacked vertically on the current page. You can choose the TYPE_ALERT style or the TYPE_GROWL style for your notifications. You can also set the widget to automatically read and display session flash messages (which is the default setting). Alternatively, you can setup and configure your own block of custom alerts.

NOTE: This extension is a sub repo split of yii2-widgets. The split has been done since 08-Nov-2014 to allow developers to install this specific widget in isolation if needed. One can also use the extension the previous way with the whole suite of yii2-widgets.

Installation

The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

To install, either run

$ php composer.phar require kartik-v/yii2-widget-alert "*"

or add

"kartik-v/yii2-widget-alert": "*"

to the require section of your composer.json file.

NOTE: Using Growl is optional and it is not automatically installed with this extension. If you want to use it in your project, you need to either run

$ php composer.phar require kartik-v/yii2-widget-growl "*"

or add

"kartik-v/yii2-widget-growl": "*"

to the require section of your composer.json file.

Refer the CHANGE LOG for details on changes to various releases.

Demo

You can refer detailed documentation and demos for Alert and AlertBlock widgets on usage of the extension.

Usage

Alert

use kartik\alert\Alert;

echo Alert::widget([
	'type' => Alert::TYPE_INFO,
	'title' => 'Note',
	'titleOptions' => ['icon' => 'info-sign'],
	'body' => 'This is an informative alert'
]);

AlertBlock

use kartik\alert\AlertBlock;

echo AlertBlock::widget([
	'type' => AlertBlock::TYPE_ALERT,
	'useSessionFlash' => true
]);

License

yii2-widget-alert is released under the BSD-3-Clause License. See the bundled LICENSE.md for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.