Skip to content

Input class

jprieton edited this page Nov 29, 2019 · 1 revision

Important: This documentation is still under construction, methods and/or properties may be missing or not fully documented

The Input Class 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

JPWP Toolkit comes with helper methods that let 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:

$something = isset($_POST['something']) ? $_POST['something'] : NULL;

With JPWP Toolkit built in methods you can simply do this:

$something = Input::post('something');

The main methods are:

Clone this wiki locally