[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/layouts/joomla/form/field/ -> range.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Site
   5   * @subpackage  Layout
   6   *
   7   * @copyright   (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  extract($displayData);
  14  
  15  /**
  16   * Layout variables
  17   * -----------------
  18   * @var   string   $autocomplete    Autocomplete attribute for the field.
  19   * @var   boolean  $autofocus       Is autofocus enabled?
  20   * @var   string   $class           Classes for the input.
  21   * @var   string   $description     Description of the field.
  22   * @var   boolean  $disabled        Is this field disabled?
  23   * @var   string   $group           Group the field belongs to. <fields> section in form XML.
  24   * @var   boolean  $hidden          Is this field hidden in the form?
  25   * @var   string   $hint            Placeholder for the field.
  26   * @var   string   $id              DOM id of the field.
  27   * @var   string   $label           Label of the field.
  28   * @var   string   $labelclass      Classes to apply to the label.
  29   * @var   boolean  $multiple        Does this field support multiple values?
  30   * @var   string   $name            Name of the input field.
  31   * @var   string   $onchange        Onchange attribute for the field.
  32   * @var   string   $onclick         Onclick attribute for the field.
  33   * @var   string   $pattern         Pattern (Reg Ex) of value of the form field.
  34   * @var   boolean  $readonly        Is this field read only?
  35   * @var   boolean  $repeat          Allows extensions to duplicate elements.
  36   * @var   boolean  $required        Is this field required?
  37   * @var   integer  $size            Size attribute of the input.
  38   * @var   boolean  $spellcheck      Spellcheck state for the form field.
  39   * @var   string   $validate        Validation rules to apply.
  40   * @var   string   $value           Value attribute of the field.
  41   * @var   array    $checkedOptions  Options that will be set as checked.
  42   * @var   boolean  $hasValue        Has this field a value assigned?
  43   * @var   array    $options         Options available for this field.
  44   * @var   array    $inputType       Options available for this field.
  45   * @var   string   $accept          File types that are accepted.
  46   * @var   string   $dataAttribute   Miscellaneous data attributes preprocessed for HTML output
  47   * @var   array    $dataAttributes  Miscellaneous data attribute for eg, data-*.
  48   */
  49  
  50  // Initialize some field attributes.
  51  $attributes = array(
  52      $class ? 'class="form-range ' . $class . '"' : 'class="form-range"',
  53      !empty($description) ? 'aria-describedby="' . ($id ?: $name) . '-desc"' : '',
  54      $disabled ? 'disabled' : '',
  55      $readonly ? 'readonly' : '',
  56      !empty($onchange) ? 'onchange="' . $onchange . '"' : '',
  57      !empty($max) ? 'max="' . $max . '"' : '',
  58      !empty($step) ? 'step="' . $step . '"' : '',
  59      !empty($min) ? 'min="' . $min . '"' : '',
  60      $autofocus ? 'autofocus' : '',
  61      $dataAttribute,
  62  );
  63  
  64  $value = is_numeric($value) ? (float) $value : $min;
  65  
  66  ?>
  67  <input
  68      type="range"
  69      name="<?php echo $name; ?>"
  70      id="<?php echo $id; ?>"
  71      value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>"
  72      <?php echo implode(' ', $attributes); ?>>


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer