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

Latest news

  • ProcessWire Weekly #518
    The 518th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 13 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits