Wrapper around the PNotify JQuery plugin

Installs: 197

Dependents: 3

Watchers: 1

Forks: 1

Language: JavaScript

Type: yii2-extension

1.1.0 2014-10-11 13:42 UTC


Wrapper around PNotify, a JavaScript notifications plugin for Bootstrap and jQuery UI.

Check out the PNotify Website for a demo of the Plugin.

important : please note that this widget only includes the basic PNotify modules : desktop and buttons


The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist raoul2000/yii2-pnotify-widget "*"

or add

"raoul2000/yii2-pnotify-widget": "*"

to the require section of your composer.json file.


Once the extension is installed, simply use it in your code like this :

        'pluginOptions' => [
            'title' => 'My Notification',
            'text' => 'this is my \'first\' Notification using <b>PNotify</b>.',


This widget includes an easy way of creating and using custom stacks that will drive the way PNotify displays notification messages.

To know more about PNotify Stacks, please refer to the documentation.

Defining a stack with the widget is easy. The example below defines a stack that will display notification vertically in the top-left corner. Then, use this stack (called "stack_top_left") to display a notification. The CSS class stack-topleft is part of the built-in CSS classes provided by PNotify.


    // define "stack_top_left' stack

            'stack_top_left' => [
                'dir1' => 'right',
                'dir2' => 'right',
                'push' => 'top'

    // display a notification using the "stack_top_left" stack.
    // Note that you must use yii\web\JsExpression for the "stack" plugin option value. 

        'pluginOptions' => [
            'title' => 'Information',
            'text' => 'This is a very intresting information message : read it !',
            'type' => 'info',
            'stack' => new yii\web\JsExpression('stack_top_left'),
            'addclass' => 'stack-topleft',
            'desktop' => [
                'desktop' => true
            'buttons' => [
                'closer_hover' => false


As you may have noted, the widget above defines specific settings for the desktop and buttons modules.

For more information on the plugin options, please refer to PNotify@github.


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