whsuite/inputs
Composer 安装命令:
composer require whsuite/inputs
包简介
Input helpers for WHSuite Framework
README 文档
README
#Input Helper
Input helper package for dealing with POST / GET / FILE vars.
##Setup
To setup place the following code somewhere in your system start up. (For WHSuite this will be app/bootstrap.php).
\Whsuite\Inputs\Inputs::init();
As default it will clean POST and GET variables from XSS bad things. You can turn this off by pass a boolean value of false in the 'init' function call.
##Usage
There are three other classes which interface with the Inputs class to make life easier.
- \Whsuite\Inputs\Post
- \Whsuite\Inputs\Get
- \Whsuite\Inputs\Files
Each of these classes have get / set functions. Access is via dot notation.
\Whsuite\Inputs\Post::get('data.Invoice.InvoiceItems.0.amount');
This would retrieve
$_POST['data']['Invoice']['InvoiceItems']['0']['amount'];
You can then set data to it as well.
\Whsuite\Inputs\Post::set('data.Invoice.InvoiceItems.0.amount', 'foobar');
Just swap Post out for any of the other classes.
\Whsuite\Inputs\Get::get();
\Whsuite\Inputs\Get::set();
\Whsuite\Inputs\Files::get();
\Whsuite\Inputs\Files::set();
Happy Inputting.
统计信息
- 总下载量: 179
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Private
- 更新时间: 2016-09-28