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 #549
    In the 549th issue of ProcessWire Weekly we’re going to check out the latest core updates, highlight one older yet still very relevant third party module, and more. Read on!
    Weekly.pw / 17 November 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“…building with ProcessWire was a breeze, I really love all the flexibility the system provides. I can’t imagine using any other CMS in the future.” —Thomas Aull