Function __global->form_input_various_ticks

Definitions

sources/form_templates.php

  • Get the Tempcode for a bank of tick (check) boxes.Note: ticks do *not* get passed into the request parameters at all if not ticked. When ticked, they will pass whatever is set for value.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$options array No No required parameter N/A N/A A list of tuples (asterisk are required): (prettyname*, name*, value, description, disabled, ticked (null or not defined: true if value is truthy))
$description mixed No No required parameter N/A N/A A description for this input field, provided in HTML format (string or Tempcode)
$_tabindex ?integer No No Null N/A N/A The tab index of the field (null: not specified)
$_pretty_name mixed No No Blank (empty string) N/A N/A A human intelligible name for this input field, provided in plain-text format (string or Tempcode) (blank: use default)
$simple_style boolean No No False N/A N/A Whether to place each tick (check) on a new line
$custom_name ?ID_TEXT No No Null N/A N/A Name for custom value to be entered to (null: no custom value allowed)
$custom_value ?mixed No No Null N/A N/A Value for custom value, string (accept single value) or array (accept multiple values) (null: no custom value known)

Returns

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

Preview

Code (PHP)

/**
 * Get the Tempcode for a bank of tick (check) boxes.Note: ticks do *not* get passed into the request parameters at all if not ticked. When ticked, they will pass whatever is set for value.
 *
 * @param  array $options A list of tuples (asterisk are required): (prettyname*, name*, value, description, disabled, ticked (null or not defined: true if value is truthy))
 * @param  mixed $description A description for this input field, provided in HTML format (string or Tempcode)
 * @param  ?integer $_tabindex The tab index of the field (null: not specified)
 * @param  mixed $_pretty_name A human intelligible name for this input field, provided in plain-text format (string or Tempcode) (blank: use default)
 * @param  boolean $simple_style Whether to place each tick (check) on a new line
 * @param  ?ID_TEXT $custom_name Name for custom value to be entered to (null: no custom value allowed)
 * @param  ?mixed $custom_value Value for custom value, string (accept single value) or array (accept multiple values) (null: no custom value known)
 * @return Tempcode The input field
 */

function form_input_various_ticks(array $options, $description, ?int $_tabindex = null, $_pretty_name = '', bool $simple_style = false, ?string $custom_name = null, $custom_value = null) : object