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 #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

“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