efureev / yii2-noty
A Yii2 wrapper widget for the Noty, a noty plugin with jQuery.
Installs: 30
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/animate.css: ~3
- bower-asset/components-font-awesome: *
- bower-asset/fe-noty: ~2
- yiisoft/yii2: ~2
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: ~5.5
This package is auto-updated.
Last update: 2024-04-29 03:10:17 UTC
README
Wrapper for https://github.com/efureev/noty
Install
Either run
composer require "efureev/yii2-noty: *"
or add
"efureev/yii2-noty": "~1",
to the require section of your composer.json file.
Methods
- alert - show the alert window
// @var string|object app.msg.alert('Alarma!...');
- info - show the info window
// @var string|object app.msg.info('Alarma!...');
- error - show the error window
// @var string|object app.msg.error('Alarma!...');
- success - show the success window
// @var string|object app.msg.success('Alarma!...');
- warning - show the warning window
// @var string|object app.msg.warning('Alarma!...');
- confirm - show the warning window
// @var string|object app.msg.confirm('Alarma!...'); //@var function onOkFn : function on click Ok //@var function onCancelFn : function on click Cancel //@var object callbacks : callbacks from noty app.msg.confirm('Alarma!...',onOkFn, onCancelFn, callbacks);
(callbacks)[http://ned.im/noty/#/about]
Run
Example 1
\efureev\noty\NotyWidget::widget();
app.msg.error('Alarma!'); app.msg.success('You are winner!'); app.msg.success('You are winner!');
Example 2: set Flashes
app()->session->setFlash('warning', 'Warning.'); app()->session->setFlash('error', 'Error.'); app()->session->setFlash('info', 'Joke.');
Tests
vendor/bin/phpunit