CoreFiles by mySites.guru
renderlabel.php45 lines, 1,237 bytes, from Joomla_6.2.1-rc1-Release_Candidate-Full_Package.zip
Raw History Compare with 6.2.0-rc2
md5
4b8102e465f0761d488bc5844d53000c
sha1
07fb6c0a2cb4e2886459dec455f1d91c66bf42f0
sha256
bdbd3f65b5d98ec93464f2ffc80b2f7b4f6603759268de3a9dc73af544670a76
<?php

/**
 * @package     Joomla.Site
 * @subpackage  Layout
 *
 * @copyright   (C) 2014 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

extract($displayData);

/**
 * Layout variables
 * -----------------
 * @var   string   $text      The label text
 * @var   string   $for       The id of the input this label is for
 * @var   boolean  $required  True if a required field
 * @var   array    $classes   A list of classes
 */

$classes = array_filter((array) $classes);
$id      = $for . '-lbl';

$isGroupedField = isset($field) && (
    $field instanceof \Joomla\CMS\Form\Field\RadioField
    || $field instanceof \Joomla\CMS\Form\Field\CheckboxesField
);

$tag = $isGroupedField ? 'span' : 'label';

if ($required) {
    $classes[] = 'required';
}

?>
<<?php echo $tag; ?> id="<?php echo $id; ?>"<?php if (!$isGroupedField) : ?> for="<?php echo $for; ?>"<?php endif; ?><?php if (!empty($classes)) {
    echo ' class="' . implode(' ', $classes) . '"';
           } ?>>
    <?php echo $text; ?><?php if ($required) :
        ?><span class="star" aria-hidden="true">&#160;*</span><?php
    endif; ?>
</<?php echo $tag; ?>>

The same content is in 3 releases, Joomla 6.2.1-rc1 to 6.3.0-alpha1. See them all, or every version of this file.