CoreFiles by mySites.guru
RadiobasicField.php70 lines, 1,538 bytes, from Joomla_5.1.1-Stable-Full_Package.zip
Raw History Compare with 5.1.0
md5
c412213c7575889b10ff5540b6b9dd1c
sha1
c12f84d9eb7c433d60962cdd5cdeb542e7f55087
sha256
4b48405906334bb30909c751c4163b6a9f960e2436240ded9999d82fad1ac63c
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Form\Field;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Form Field class for the Joomla Platform.
 * Provides radio button inputs using default styling
 *
 * @since  4.0.0
 */
class RadiobasicField extends ListField
{
    /**
     * The form field type.
     *
     * @var    string
     * @since  4.0.0
     */
    protected $type = 'Radiobasic';

    /**
     * Name of the layout being used to render the field
     *
     * @var    string
     * @since  4.0.0
     */
    protected $layout = 'joomla.form.field.radiobasic';

    /**
     * Method to get the radio button field input markup.
     *
     * @return  string  The field input markup.
     *
     * @since   4.0.0
     */
    protected function getInput()
    {
        return $this->getRenderer($this->layout)->render($this->collectLayoutData());
    }

    /**
     * Method to get the data to be passed to the layout for rendering.
     *
     * @return  array
     *
     * @since   4.0.0
     */
    protected function getLayoutData()
    {
        $data = parent::getLayoutData();

        $extraData = [
            'options' => $this->getOptions(),
            'value'   => (string) $this->value,
        ];

        return array_merge($data, $extraData);
    }
}

The same content is in 20 releases, Joomla 5.1.0-beta1 to 5.2.0-beta1. See them all, or every version of this file.