Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jprieton/jp-toolkit-request-helper
JP Toolkit Request Helper for WordPress contains a set of methods to facilitate handling form requests.
https://github.com/jprieton/jp-toolkit-request-helper
form jp-toolkit request wordpress wordpress-development wordpress-plugin wordpress-theme
Last synced: 16 days ago
JSON representation
JP Toolkit Request Helper for WordPress contains a set of methods to facilitate handling form requests.
- Host: GitHub
- URL: https://github.com/jprieton/jp-toolkit-request-helper
- Owner: jprieton
- License: gpl-3.0
- Created: 2020-04-19T11:23:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-16T12:08:37.000Z (9 months ago)
- Last Synced: 2024-10-17T08:37:12.081Z (about 1 month ago)
- Topics: form, jp-toolkit, request, wordpress, wordpress-development, wordpress-plugin, wordpress-theme
- Language: PHP
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JP Toolkit Request Helper
This helper serves two purposes:
1. It pre-processes global input data for security.
2. It provides some helper methods for fetching input data and pre-processing it.
## Accessing form data
### Using POST, GET, COOKIE, or SERVER Data
This helper let to you fetch POST, GET, COOKIE or SERVER items. The main advantage of using the provided methods rather than fetching an item directly `$_POST['something']` is that the methods will check to see if the item is set and return NULL if not. This lets you conveniently use data without having to test whether an item exists first. In other words, normally you might do something like this:
```php
$something = isset($_POST['something']) ? $_POST['something'] : 'default value';
```
With this helper methods you can simply do this:```php
$something = Request::post('something', 'default value');
```Please read our [Wiki](https://github.com/jprieton/jp-toolkit-request-helper/wiki) for more detailed information, advanced usage and shorthands.
## Autoloading
You'll need to use an autoloader with this. Ideally, this would be [Composer](https://getcomposer.org).
### Composer
From the command line:
```bash
composer require jp-toolkit/request-helper
```
## Bug tracker?
Have a bug? Please create an issue on GitHub at https://github.com/jprieton/jp-toolkit-request-helper/issues)