System:Params

From Aspen Documentation

For full public method documentation, see the API Manual.

Inspekt Documentation

The Params class acts as a wrapper to the PHP superglobals. Each function allows you pass the first argument as an index name and the second argument as a default value. Aspen uses a class called Inspekt as it's superglobal handler.

For example, calling:

$var = $_GET['myvalue'];

Produces a wide range of issues. You need to add in logic checking that the array index exists, and that contents are safe.

The Inspekt class provides a method to access the same data, but it adds those layers of logic around each call.

Using the class would be as simple as:

$var = $this->APP->params->get->getAlnum('myvalue');

The possible methods include wrappers for the following:

  • GET
  • POST
  • SESSION
  • COOKIE
  • SERVER
  • ENV