Version: v0.6.0 - Beta.  We welcome contributors & feedback.  THanks!

Input.get

Input.get($fieldName, $validationRule='')

Description

Get an input field sent in a GET request (query string).

It will be validated per $validationRule. (See Input Validation)

If $validationRule is an empty string, it will look for a rule that is contained in the field name.

// URL - /profile?userId=12345

Input.get('userId', 'id');
//= 12345

// Uses 'id' rule because the name ends in '-id'
Input.get('userId');
//= 12345

// URL - /profile?userId=bad+value
Input.get('userId');
//= ''  (invalid)