dev-master
9999999-devInput helpers for WHSuite Framework
Private
The Requires
by Audun Larsen
by WHSuite
Input helpers for WHSuite Framework
Input helper package for dealing with POST / GET / FILE vars., (*1)
To setup place the following code somewhere in your system start up. (For WHSuite this will be app/bootstrap.php)., (*2)
\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., (*3)
There are three other classes which interface with the Inputs class to make life easier., (*4)
Each of these classes have get / set functions. Access is via dot notation., (*5)
\Whsuite\Inputs\Post::get('data.Invoice.InvoiceItems.0.amount');
, (*6)
This would retrieve, (*7)
$_POST['data']['Invoice']['InvoiceItems']['0']['amount'];
, (*8)
You can then set data to it as well., (*9)
\Whsuite\Inputs\Post::set('data.Invoice.InvoiceItems.0.amount', 'foobar');
, (*10)
Just swap Post out for any of the other classes., (*11)
\Whsuite\Inputs\Get::get();
\Whsuite\Inputs\Get::set();
, (*12)
\Whsuite\Inputs\Files::get();
\Whsuite\Inputs\Files::set();
, (*13)
Happy Inputting., (*14)
Input helpers for WHSuite Framework
Private