<?php

use Jet\MVC_View;
use Jet\Form_Renderer_Field_Label;

/**
 * @var MVC_View $this
 * @var Form_Renderer_Field_Label $r
 */
$r = $this->getRaw( 'renderer' );

if( !$r->getBaseCssClasses() ) {
	$r->setBaseCssClass( 'col-form-label' );
}

$r->setWidthCssClassesCreator(function( $size, $width ) {
	return '';
});

$r->setCustomTagAttribute( 'for', $r->getField()->getId() );

?>
<label <?=$r->renderTagAttributes()?>><?php
	
	if( $r->getField()->getIsRequired() ):
		?><em class="form-required">*</em><?php
	endif;

	echo $r->getField()->getLabel();
	
?></label>