2017 © Pedro Peláez
 

library input

A Input class for that makes it easier for accessing user input

image

como/input

A Input class for that makes it easier for accessing user input

  • Wednesday, February 12, 2014
  • by rmccullagh
  • Repository
  • 0 Watchers
  • 1 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Input

This is a library that makes it easier to safely retrieve user input. The class provides an abstraction to the superglobals $_GET and $_POST arrays. It is typically unsafe to operate directly on those arrays as it is easy to forget to do the validation neccessary to prevent unexpected behavior., (*1)

For example if your url is a GET request like this: example.com/index.php?id[]=111, then you would normally access that value from the 'id' subscript of the $_POST array. However, if your application then proceeds to try and pass that value to a method that requires a string type value, you will have trouble because $_POST['id'] is in fact an array and not a string., (*2)

The Input class handles these things automatically for you by peforming these checks. It also sanitzes all values subsequently making an input value safe for output on the client such as a web browser., (*3)

To Use

require DIR . '/vendor/autoload.php';, (*4)

use \Como\Http\Input;, (*5)

// this will return the default value if the q request is an array var_dump(Input::get('q', Input::FILTER_ARRAY, $default = 'default value'));, (*6)

// this will allow an array var_dump(Input::get('q', Input::NO_FILTER_ARRAY, $default = 'default value'));, (*7)

To install via composer:

create a composer.json file with this:, (*8)

{ "require": { "como/input": "dev-master" } }, (*9)

then run composer install in the directory of your choice, (*10)

To install from GitHub

git clone http://github.com/rmccullagh/como-http.git, (*11)

Then open up the test.php file and take a look at the examples., (*12)

The Versions

12/02 2014

dev-master

9999999-dev http://github.com/rmccullagh/como-http

A Input class for that makes it easier for accessing user input

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

http input

08/02 2014

1.0.2

1.0.2.0 http://github.com/rmccullagh/como-http

A Input class for that makes it easier for accessing user input

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

http input

06/02 2014

1.0.1

1.0.1.0 http://github.com/rmccullagh/como-http

A Input class for that makes it easier for accessing user input

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

http input

06/02 2014

dev-develop

dev-develop http://github.com/rmccullagh/como-http

A Input class for that makes it easier for accessing user input

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

http input