yiier / yii2-notification
Notification for Yii2
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-10-29 05:28:51 UTC
README
Notification for Yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yiier/yii2-notification "*"
or add
"yiier/yii2-notification": "*"
to the require section of your composer.json
file.
Migrations
Run the following command
$ php yii migrate --migrationPath=@yiier/notification/migrations/
Usage
Config
Configure Controller class as follows : :
<?php use yiier\notification\actions\NotificationAction; class NotificationController extends Controller { public function actions() { return [ 'do' => [ 'class' => NotificationAction::className(), ] ]; } }
Url
POST: http://xxxxxxxxxxxxxx/notification/do
Form Data: action=read_all
POST: http://xxxxxxxxxxxxxx/notification/do
Form Data: action=read_all&ids=1,2,3
POST: http://xxxxxxxxxxxxxx/notification/do
Form Data: action=delete_all
POST: http://xxxxxxxxxxxxxx/notification/do
Form Data: action=delete_all&ids=1,2,3
POST: http://xxxxxxxxxxxxxx/notification/do
Form Data: action=delete&id=1
action=delete
you can use action=Notification::DEL_ACTION
http response success(code==200) return json:
{"code":200,"data":0,"message":"success"}
http response failure(code==500) return json:
{"code":500,"data":"","message":"xxxx"}
More Notification