[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

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

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2016 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 using default styling
  19   *
  20   * @since  4.0.0
  21   */
  22  class RadiobasicField extends ListField
  23  {
  24      /**
  25       * The form field type.
  26       *
  27       * @var    string
  28       * @since  4.0.0
  29       */
  30      protected $type = 'Radiobasic';
  31  
  32      /**
  33       * Name of the layout being used to render the field
  34       *
  35       * @var    string
  36       * @since  4.0.0
  37       */
  38      protected $layout = 'joomla.form.field.radiobasic';
  39  
  40      /**
  41       * Method to get the radio button field input markup.
  42       *
  43       * @return  string  The field input markup.
  44       *
  45       * @since   4.0.0
  46       */
  47      protected function getInput()
  48      {
  49          return $this->getRenderer($this->layout)->render($this->getLayoutData());
  50      }
  51  
  52      /**
  53       * Method to get the data to be passed to the layout for rendering.
  54       *
  55       * @return  array
  56       *
  57       * @since   4.0.0
  58       */
  59      protected function getLayoutData()
  60      {
  61          $data = parent::getLayoutData();
  62  
  63          $extraData = array(
  64              'options' => $this->getOptions(),
  65              'value'   => (string) $this->value
  66          );
  67  
  68          return array_merge($data, $extraData);
  69      }
  70  }


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