https://github.com/yiier/yii2-request-behavior
The request behavior for the Yii framework
https://github.com/yiier/yii2-request-behavior
Last synced: 2 months ago
JSON representation
The request behavior for the Yii framework
- Host: GitHub
- URL: https://github.com/yiier/yii2-request-behavior
- Owner: yiier
- Created: 2015-09-11T06:13:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-12T14:02:45.000Z (over 9 years ago)
- Last Synced: 2024-04-14T08:31:40.075Z (about 1 year ago)
- Language: PHP
- Size: 124 KB
- Stars: 2
- Watchers: 14
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Request Behavior for Yii 2
==========================
The request behavior for the Yii frameworkInstallation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist yiier/yii2-request-behavior "dev-master"
```or add
```
"yiier/yii2-request-behavior": "dev-master"
```to the require section of your `composer.json` file.
Usage
-----Once the extension is installed, simply use it in your Controller code by :
```php
public function behaviors()
{
return [
// code ...
[
'class' => ThrottleBehavior::className(),
'message'=>'您操作太频繁了,10秒内不能重复操作。'
],
];
}
```