InputfieldText class

Single line of text

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

Show class?             Show args?        

Common

NameReturnSummary 
getAttributes()
arrayGet all attributes in an associative array 
getConfigAllowContext(Field $field)
arrayGet array of field names allowed for field/template context
getConfigInputfields()
InputfieldWrapperGet field configuration
getDefaultMaxlength()
intGet the default maxlength attribute value 
initValue string Optional initial/default value 
maxlength int Maximum allowed length of value 
minlength int Minimum allowed length of value (usually combined with 'required' option) 
noTrim bool By default whitespace is trimmed from value, set this to true to bypass that behavior (default=false). 
pattern string HTML5 pattern attribute 
placeholder string Placeholder attribute text 
processInput(WireInputData $input)
$thisProcess input
render()
stringRender Inputfield
renderReady()
boolRender ready 
renderValue()
stringRender just the value (not input) in text/markup for presentation purposes.
requiredAttr bool int When combined with "required" option, this also makes it use the HTML5 "required" attribute. (default=false) 
setAttribute($key, $value)
Inputfield InputfieldText thisSet an attribute 
showCount int Show a character counter (1) or word counter (2) or neither (0). Recommended value is 1 when using minlength or maxlength. 
size int Size of input or 0 for full width 
stripTags bool Should HTML tags be stripped from value? 
type string Input type (typically "text") 
useLanguages bool When combined with multi-language support, setting this to true will provide one input per language. Get/set each language value with the "value[languageID]" property, and just "value" for default language.  
wired()
(nothing)Wired to API 

Additional methods and properties

In addition to the methods and properties above, InputfieldText 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