PHP code example of raoul2000 / yii2-pnotify-widget

1. Go to this page and download the library: Download raoul2000/yii2-pnotify-widget library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

raoul2000 / yii2-pnotify-widget example snippets


 
	\raoul2000\widget\pnotify\PNotify::widget([
		'pluginOptions' => [
			'title' => 'My Notification',
			'text' => 'this is my \'first\' Notification using <b>PNotify</b>.',
		]
	]);

 
	
	// define "stack_top_left' stack
	
	\raoul2000\widget\pnotify\PNotify::registerStack( 
		[
			'stack_top_left' => [
				'dir1' => 'right',
				'dir2' => 'right',
				'push' => 'top'
			]
		],
		$this
	);
	
	// display a notification using the "stack_top_left" stack.
	// Note that you must use yii\web\JsExpression for the "stack" plugin option value. 
	
	\raoul2000\widget\pnotify\PNotify::widget([
		'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
			]
		]
	]);	
	

php composer.phar