Function __global->_form_input
Definitions
sources/form_templates.php
- Helper function to show an input field.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: object
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $name | ID_TEXT | No | No | required parameter | N/A | N/A | The codename for this field (blank: N/A) |
| $pretty_name | mixed | No | No | required parameter | N/A | N/A | A human intelligible name for this input field, provided in plain-text format (string or Tempcode) |
| $description | mixed | No | No | required parameter | N/A | N/A | A description for this input field, provided in HTML format (string or Tempcode) |
| $input | Tempcode | No | No | required parameter | N/A | N/A | The actual raw input field |
| $required | boolean | No | No | required parameter | N/A | N/A | Whether it is required that this field be filled in |
| $comcode | boolean | No | No | False | N/A | N/A | Whether this field may contain Comcode |
| $tabindex | ?integer | No | No | Null | N/A | N/A | The tab index (null: none specified) |
| $w | boolean | No | No | False | N/A | N/A | Whether it is a textarea field |
| $skip_label | boolean | No | No | False | N/A | N/A | Whether to skip displaying a label for the field |
| $description_side | mixed | No | No | Blank (empty string) | N/A | N/A | A secondary side description for this input field, provided in HTML format (string or Tempcode) |
| $pattern_error | ?string | No | No | Null | N/A | N/A | Custom regex pattern validation error (null: none) |
Returns
- The field
- Type: Tempcode
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Helper function to show an input field.
*
* @param ID_TEXT $name The codename for this field (blank: N/A)
* @param mixed $pretty_name A human intelligible name for this input field, provided in plain-text format (string or Tempcode)
* @param mixed $description A description for this input field, provided in HTML format (string or Tempcode)
* @param Tempcode $input The actual raw input field
* @param boolean $required Whether it is required that this field be filled in
* @param boolean $comcode Whether this field may contain Comcode
* @param ?integer $tabindex The tab index (null: none specified)
* @param boolean $w Whether it is a textarea field
* @param boolean $skip_label Whether to skip displaying a label for the field
* @param mixed $description_side A secondary side description for this input field, provided in HTML format (string or Tempcode)
* @param ?string $pattern_error Custom regex pattern validation error (null: none)
* @return Tempcode The field
*/
function _form_input(string $name, $pretty_name, $description, object $input, bool $required, bool $comcode = false, ?int $tabindex = null, bool $w = false, bool $skip_label = false, $description_side = '', ?string $pattern_error = null) : object
* Helper function to show an input field.
*
* @param ID_TEXT $name The codename for this field (blank: N/A)
* @param mixed $pretty_name A human intelligible name for this input field, provided in plain-text format (string or Tempcode)
* @param mixed $description A description for this input field, provided in HTML format (string or Tempcode)
* @param Tempcode $input The actual raw input field
* @param boolean $required Whether it is required that this field be filled in
* @param boolean $comcode Whether this field may contain Comcode
* @param ?integer $tabindex The tab index (null: none specified)
* @param boolean $w Whether it is a textarea field
* @param boolean $skip_label Whether to skip displaying a label for the field
* @param mixed $description_side A secondary side description for this input field, provided in HTML format (string or Tempcode)
* @param ?string $pattern_error Custom regex pattern validation error (null: none)
* @return Tempcode The field
*/
function _form_input(string $name, $pretty_name, $description, object $input, bool $required, bool $comcode = false, ?int $tabindex = null, bool $w = false, bool $skip_label = false, $description_side = '', ?string $pattern_error = null) : object

