Function __global->form_input_line

Definitions

sources/form_templates.php

  • Get the Tempcode for a text input line (an <input type="text" ... />).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$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)
$name ID_TEXT No No required parameter N/A N/A The name which this input field is for
$default ?string No No required parameter N/A N/A The default value for this input field (null: blank)
$required boolean No No required parameter N/A N/A Whether this is a required input field
$tabindex ?integer No No Null N/A N/A The tab index of the field (null: not specified)
$_maxlength ?integer No No Null N/A N/A The maximum length of the field (null: default 255)
$type string No No text N/A N/A The input type
$placeholder ?string No No Null N/A N/A The placeholder value for this input field (null: none)
$pattern ?string No No Null N/A N/A Custom regex pattern, covers whole field value (null: none)
$pattern_error ?string No No Null N/A N/A Custom regex pattern validation error (null: none)
$size ?integer No No Null N/A N/A How much space the list takes up (inline lists only) (null: default 27)
$autocomplete ~?mixed No No Null N/A N/A The autocomplete field name. (false: explicitly disable autocomplete) (null: no autocomplete attribute unless there's a default for this $name)

Returns

  • The input field
  • Type: Tempcode
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get the Tempcode for a text input line (an <input type="text" ... />).
 *
 * @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  ID_TEXT $name The name which this input field is for
 * @param  ?string $default The default value for this input field (null: blank)
 * @param  boolean $required Whether this is a required input field
 * @param  ?integer $tabindex The tab index of the field (null: not specified)
 * @param  ?integer $_maxlength The maximum length of the field (null: default 255)
 * @param  string $type The input type
 * @param  ?string $placeholder The placeholder value for this input field (null: none)
 * @param  ?string $pattern Custom regex pattern, covers whole field value (null: none)
 * @param  ?string $pattern_error Custom regex pattern validation error (null: none)
 * @param  ?integer $size How much space the list takes up (inline lists only) (null: default 27)
 * @param  ~?mixed $autocomplete The autocomplete field name. (false: explicitly disable autocomplete) (null: no autocomplete attribute unless there's a default for this $name)
 * @return Tempcode The input field
 */

function form_input_line($pretty_name, $description, string $name, ?string $default, bool $required, ?int $tabindex = null, ?int $_maxlength = null, string $type = 'text', ?string $placeholder = null, ?string $pattern = null, ?string $pattern_error = null, ?int $size = null, $autocomplete = null) : object