[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Form/Field/ -> HiddenField.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  namespace Joomla\CMS\Form\Field;
  11  
  12  use Joomla\CMS\Form\FormField;
  13  
  14  // phpcs:disable PSR1.Files.SideEffects
  15  \defined('JPATH_PLATFORM') or die;
  16  // phpcs:enable PSR1.Files.SideEffects
  17  
  18  /**
  19   * Form Field class for the Joomla Platform.
  20   * Provides a hidden field
  21   *
  22   * @link   https://html.spec.whatwg.org/multipage/input.html#hidden-state-(type=hidden)
  23   * @since  1.7.0
  24   */
  25  class HiddenField extends FormField
  26  {
  27      /**
  28       * The form field type.
  29       *
  30       * @var    string
  31       * @since  1.7.0
  32       */
  33      protected $type = 'Hidden';
  34  
  35      /**
  36       * Name of the layout being used to render the field
  37       *
  38       * @var    string
  39       * @since  3.7
  40       */
  41      protected $layout = 'joomla.form.field.hidden';
  42  
  43      /**
  44       * Method to get the field input markup.
  45       *
  46       * @return  string  The field input markup.
  47       *
  48       * @since   1.7.0
  49       */
  50      protected function getInput()
  51      {
  52          // Trim the trailing line in the layout file
  53          return rtrim($this->getRenderer($this->layout)->render($this->getLayoutData()), PHP_EOL);
  54      }
  55  
  56      /**
  57       * Method to get the data to be passed to the layout for rendering.
  58       *
  59       * @return  array
  60       *
  61       * @since 3.7
  62       */
  63      protected function getLayoutData()
  64      {
  65          return parent::getLayoutData();
  66      }
  67  }


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