Version: v0.7.1 - Beta.  We welcome contributors & feedback.

Input.post

Input.post($fieldName, $ruleset = 'id') -> any

Description

Get an input field value sent via HTTP POST (usually via a form or Ajax request).

It will be validated per the given $ruleset. (See Input Validation)

If it does not pass validation, a default value will be returned for its type.

// POST: name=Tal+Thorson&age=33

Input.post('name', 's')
//= 'Tal Thorson'

Input.post('age', 'i|max: 130')
//= 33

Input.post('favoriteColor', 's')
//= ''  (default)

Input.post('heightCm', 'i')
//= 0  (default)

See Also