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

Latest news

  • ProcessWire Weekly #554
    In the 554th issue of ProcessWire Weekly we'll check out the latest core updates, introduce a couple of new third party modules, and more. Read on!
    Weekly.pw / 21 December 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

“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