bigdropinc/yii2-ajax-access-rule
Composer 安装命令:
composer require bigdropinc/yii2-ajax-access-rule
包简介
Ajax access rule for yii2 access filter
README 文档
README
Ajax access rule for yii2 access filter
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist bigdropinc/yii2-ajax-access-rule "*"
or add
bigdropinc/yii2-ajax-access-rule
to the require section of your composer.json file.
Usage
For AccessControl rules use AjaxRule::className()
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'class' => AjaxRule::className(),
'actions' => ['some-action'],
'verbs' => ['POST'],
'allow' => true #this will allow only ajax requests for specified action
],
[
'class' => AjaxRule::className(),
'actions' => ['another-action'],
'allow' => false #this will allow only non-ajax request for specified action
],
]
]
统计信息
- 总下载量: 231
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-03-30