Input Manager

The Input Manager makes it easier accessing GET and POST for the request as well as old input data from the previous form request.

The easiest way to use the Hasher is to make sure your Controllers extend Tomahawk\Routing\Controller. You then have access to it through $this->input.

Other wise just add the following parameter to the construct method of your Controller Tomahawk\Input\InputInterface and it will get injected in through the Service Container.

Accessing GET data

There are 3 ways of accessing the data from the query string.

The get method can be used to get all or one value from the query string.

The getOnly method can be used to get only the specified values from the query string.

The getExcept method can be used to get everything but the specified values from the query string.

Accessing POST data

There are 3 ways of accessing the data from the request.

The post method can be used to get all or one value from the request.

The postOnly method can be used to get only the specified values from the request.

The postExcept method can be used to get everything but the specified values from the request.

This method is useful when you want to flash input, but ignoring sensitive data use as passwords.

Flashing input for the next request

You way make to make some data available for the next request, for example if validation fails and you want to redirect back to the form. For this you would use the flashInput method.

The flashed data is available for the next request and removed at the end of that request.

Accessing flashed input on the next request

Once you've flashed input on the next request you can access it using the following methods:

You can also check if a value has been flashed: