WireInputData class

Located in file /wire/core/WireInputData.php

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the WireInputData class also inherits all the methods and properties of: Wire.

Show class?             Show args?        

Common

NameReturnSummary 
array($varName)
arraySanitize array or CSV String to an array, optionally running elements through specified $sanitizer.
bool($varName)
boolSanitize value to boolean (true or false)
callUnknown(string $method, array $arguments)
string int array float nullMaps to Sanitizer functions
count()
(nothing) 
date($varName, $dateFormat)
stringValidate and return $varName in the given PHP date() or strftime() format.
email($varName)
stringSanitize email address, converting to blank if invalid
emailHeader($varName)
stringSanitize string for use in an email header
entities($varName)
stringReturn an entity encoded version of the value
fieldName($varName)
stringSanitize to ProcessWire Field name format
filename($varName)
stringSanitize to valid file basename as used by filenames in ProcessWire
find(string $pattern)
arrayFind all input vars that match given pattern in name (or optionally value) 
findOne(string $pattern)
string int float array nullFind one input var that matches given pattern in name (or optionally value) 
float($varName)
floatSanitize value to float with optional min and max values.
get(string $key)
string int float array nullGet a value 
getArray()
arrayGet associative array of all input variables 
getIterator()
(nothing) 
int($varName)
intSanitize value to integer with optional min and max. Unsigned if max >= 0, signed if max < 0.
intArray($varName)
arraySanitize array or CSV string to an array of integers with optional min and max values.
intSigned($varName)
intSanitize value to signed integer with optional min and max.
intUnsigned($varName)
intSanitize value to unsigned integer with optional min and max.
name($varName)
stringSanitize to ProcessWire name format
offsetExists($key)
(nothing) 
offsetGet($key)
(nothing) 
offsetSet($key, $value)
(nothing) 
offsetUnset($key)
(nothing) 
option($varName, array $allowedValues)
string nullReturn value of $varName only if it exists in $allowedValues.
options($varName, array $allowedValues)
arrayReturn all values in array $varName that also exist in $allowedValues.
pageName($varName)
stringSanitize to ProcessWire Page name format
pageNameTranslate($varName)
stringSanitize to ProcessWire Page name format with translation of non-ASCII characters to ASCII equivalents
pagePathName($varName)
stringSanitize to what could be a valid page path in ProcessWire
purify($varName)
stringReturn a value run through HTML Purifier (value assumed to contain HTML)
remove(string $key)
$thisRemove a value from input 
removeAll()
$thisRemove all values from input 
selectorField($varName)
stringSanitize a field name for use in a selector string
selectorValue($varName)
stringSanitize a value for use in a selector string
set(string $key, $value)
$thisSet a value 
setArray(array $input)
$thisSet associative array of variables to store 
setStripSlashes($stripSlashes)
(nothing)Set whether or not slashes should be stripped 
string($varName)
stringReturn a value guaranteed to be a string, regardless of what type $varName is. Does not sanitize.
templateName($varName)
stringSanitize to ProcessWire Template name format
text($varName)
string) Sanitize to single line of text up to 255 characters (1024 bytes max), HTML markup is removed
textarea($varName)
stringSanitize to multi-line text up to 16k characters (48k bytes), HTML markup is removed
url($varName)
stringSanitize to a valid URL, or convert to blank if it can't be sanitized
varName($varName)
stringSanitize to PHP variable name format

Additional methods and properties

In addition to the methods and properties above, WireInputData also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.244

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani