raoul2000/yii2-pnotify-widget 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

raoul2000/yii2-pnotify-widget

Composer 安装命令:

composer require raoul2000/yii2-pnotify-widget

包简介

Wrapper around the PNotify JQuery plugin

README 文档

README

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

Installation

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.

Usage

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

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

Stacks

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.

<?php 
	
	// 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
			]
		]
	]);	
	
?>

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.

License

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

统计信息

  • 总下载量: 15.04k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-06-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固