Skip to content

Commit 7fb7036

Browse files
committed
usage instructions in readme
1 parent c7cf189 commit 7fb7036

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

readme.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,32 @@ To install XssInput as a Composer package to be used with Laravel 4, simply add
3535

3636
You could also, instead of doing this, give the XssInput facade a separate alias.
3737

38-
Then publish the config file with `php artisan config:publish frozennode/xssinput`. This will add the file `app/config/packages/frozennode/xssinput/xssinput.php`, which you should look at and understand because it's one option long.
38+
Then publish the config file with `php artisan config:publish frozennode/xssinput`. This will add the file `app/config/packages/frozennode/xssinput/xssinput.php`, which you should look at and understand because it's one option long.
39+
40+
## Usage
41+
42+
It really is screamingly simple. If you've set the global xss filtering to `true`, then you can continue using the Input facade as you normally would:
43+
44+
```php
45+
Input::get('some_var');
46+
```
47+
48+
The same goes for getting all inputs:
49+
50+
```php
51+
Input::all();
52+
```
53+
54+
However, if you don't have global xss filtering on, you can pass in a third parameter to the `get()` method:
55+
56+
```php
57+
Input::get('some_var', null, true);
58+
```
59+
60+
Or pass in `true` to the `all()` method:
61+
62+
```php
63+
Input::all(true);
64+
```
65+
66+
If you have global filtering on, you can pass `false` in as these parameters to turn off filtering for that particular callto either method.

0 commit comments

Comments
 (0)