[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/layouts/joomla/form/field/ -> url.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  use Joomla\CMS\String\PunycodeHelper;
  14  
  15  extract($displayData);
  16  
  17  /**
  18   * Layout variables
  19   * -----------------
  20   * @var   string   $autocomplete    Autocomplete attribute for the field.
  21   * @var   boolean  $autofocus       Is autofocus enabled?
  22   * @var   string   $class           Classes for the input.
  23   * @var   string   $description     Description of the field.
  24   * @var   boolean  $disabled        Is this field disabled?
  25   * @var   string   $group           Group the field belongs to. <fields> section in form XML.
  26   * @var   boolean  $hidden          Is this field hidden in the form?
  27   * @var   string   $hint            Placeholder for the field.
  28   * @var   string   $id              DOM id of the field.
  29   * @var   string   $label           Label of the field.
  30   * @var   string   $labelclass      Classes to apply to the label.
  31   * @var   boolean  $multiple        Does this field support multiple values?
  32   * @var   string   $name            Name of the input field.
  33   * @var   string   $onchange        Onchange attribute for the field.
  34   * @var   string   $onclick         Onclick attribute for the field.
  35   * @var   string   $pattern         Pattern (Reg Ex) of value of the form field.
  36   * @var   boolean  $readonly        Is this field read only?
  37   * @var   boolean  $repeat          Allows extensions to duplicate elements.
  38   * @var   boolean  $required        Is this field required?
  39   * @var   integer  $size            Size attribute of the input.
  40   * @var   boolean  $spellcheck      Spellcheck state for the form field.
  41   * @var   string   $validate        Validation rules to apply.
  42   * @var   string   $value           Value attribute of the field.
  43   * @var   array    $checkedOptions  Options that will be set as checked.
  44   * @var   boolean  $hasValue        Has this field a value assigned?
  45   * @var   array    $options         Options available for this field.
  46   * @var   array    $inputType       Options available for this field.
  47   * @var   string   $accept          File types that are accepted.
  48   * @var   string   $dataAttribute   Miscellaneous data attributes preprocessed for HTML output
  49   * @var   array    $dataAttributes  Miscellaneous data attribute for eg, data-*.
  50   */
  51  
  52  $attributes = array(
  53      !empty($size) ? ' size="' . $size . '"' : '',
  54      !empty($description) ? ' aria-describedby="' . ($id ?: $name) . '-desc"' : '',
  55      $disabled ? ' disabled' : '',
  56      $readonly ? ' readonly' : '',
  57      strlen($hint) ? ' placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : '',
  58      !empty($autocomplete) ? 'autocomplete="' . $autocomplete . '"' : '',
  59      $autofocus ? ' autofocus' : '',
  60      $spellcheck ? '' : ' spellcheck="false"',
  61      $onchange ? ' onchange="' . $onchange . '"' : '',
  62      !empty($maxLength) ? $maxLength : '',
  63      $required ? ' required' : '',
  64      $dataAttribute,
  65  );
  66  
  67  // @deprecated  5.0 The unicode conversion of the URL will be moved to \Joomla\CMS\Form\Field\UrlField::getLayoutData
  68  if ($value !== null) {
  69      $value = $this->escape(PunycodeHelper::urlToUTF8($value));
  70  }
  71  ?>
  72  <input
  73      <?php echo $inputType; ?>
  74      inputmode="url"
  75      name="<?php echo $name; ?>"
  76      <?php echo !empty($class) ? ' class="form-control ' . $class . '"' : 'class="form-control"'; ?>
  77      id="<?php echo $id; ?>"
  78      value="<?php echo $value; ?>"
  79      <?php echo implode(' ', $attributes); ?>>


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