Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yiier/yii2-notification
Yii2 notification 站内信 通知
https://github.com/yiier/yii2-notification
yii2-extension
Last synced: 3 months ago
JSON representation
Yii2 notification 站内信 通知
- Host: GitHub
- URL: https://github.com/yiier/yii2-notification
- Owner: yiier
- License: bsd-3-clause
- Created: 2018-01-31T08:40:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-31T09:05:22.000Z (over 3 years ago)
- Last Synced: 2024-04-14T00:35:01.239Z (10 months ago)
- Topics: yii2-extension
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-yii2 - yiier/yii2-notification
README
Notification for Yii2
=====================
Notification for Yii2[![Latest Stable Version](https://poser.pugx.org/yiier/yii2-notification/v/stable)](https://packagist.org/packages/yiier/yii2-notification)
[![Total Downloads](https://poser.pugx.org/yiier/yii2-notification/downloads)](https://packagist.org/packages/yiier/yii2-notification)
[![Latest Unstable Version](https://poser.pugx.org/yiier/yii2-notification/v/unstable)](https://packagist.org/packages/yiier/yii2-notification)
[![License](https://poser.pugx.org/yiier/yii2-notification/license)](https://packagist.org/packages/yiier/yii2-notification)Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
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
```shell
$ php yii migrate --migrationPath=@yiier/notification/migrations/
```Usage
-----**Config**
Configure Controller class as follows : :
```php
[
'class' => NotificationAction::className(),
]
];
}
}```
**Url**
```
POST: http://xxxxxxxxxxxxxx/notification/do
Form Data: action=read_allPOST: http://xxxxxxxxxxxxxx/notification/do
Form Data: action=read_all&ids=1,2,3POST: http://xxxxxxxxxxxxxx/notification/do
Form Data: action=delete_allPOST: http://xxxxxxxxxxxxxx/notification/do
Form Data: action=delete_all&ids=1,2,3POST: 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:
```json
{"code":200,"data":0,"message":"success"}
```
http response failure(code==500) return json:```json
{"code":500,"data":"","message":"xxxx"}
```More [Notification](/src/models/Notification.php)