[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Form/Field/ -> RadioField.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  // phpcs:disable PSR1.Files.SideEffects
  13  \defined('JPATH_PLATFORM') or die;
  14  // phpcs:enable PSR1.Files.SideEffects
  15  
  16  /**
  17   * Form Field class for the Joomla Platform.
  18   * Provides radio button inputs
  19   *
  20   * @link   https://html.spec.whatwg.org/multipage/input.html#radio-button-state-(type=radio)
  21   * @since  1.7.0
  22   */
  23  class RadioField extends ListField
  24  {
  25      /**
  26       * The form field type.
  27       *
  28       * @var    string
  29       * @since  1.7.0
  30       */
  31      protected $type = 'Radio';
  32  
  33      /**
  34       * Name of the layout being used to render the field
  35       *
  36       * @var    string
  37       * @since  3.5
  38       */
  39      protected $layout = 'joomla.form.field.radio.buttons';
  40  
  41      /**
  42       * Method to get the data to be passed to the layout for rendering.
  43       *
  44       * @return  array
  45       *
  46       * @since   3.5
  47       */
  48      protected function getLayoutData()
  49      {
  50          $data = parent::getLayoutData();
  51  
  52          $extraData = array(
  53              'options' => $this->getOptions(),
  54              'value'   => (string) $this->value,
  55          );
  56  
  57          return array_merge($data, $extraData);
  58      }
  59  }


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