infuse/csrf
Composer 安装命令:
composer require infuse/csrf
包简介
Anti-CSRF module for Infuse Framework
README 文档
README
CSRF protection for Infuse Framework. Built on symfony/security-csrf.
Installation
-
Install the package with composer:
composer require infuse/csrf -
Add the services in your app's configuration:
'services' => [ // ... 'csrf' => 'Infuse\Csrf\Csrf', 'csrf_tokens' => 'Infuse\Csrf\CsrfTokens', // ... ]
-
Add the middleware to your app:
$app->middleware($app['csrf']);
Usage
Any POST, PUT, PATCH, and DELETE request that has the middleware installed will check for a valid CSRF token. With a line of code you can add CSRF tokens to a form (Smarty example):
<form action="/transfer" method="POST"> {$app.csrf->render($req) nofilter} <!-- rest of your form... --> </form>
统计信息
- 总下载量: 200
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-26