Esempio n. 1
0
isset($labelAttributes) || ($labelAttributes = []);
isset($containerAttributes) || ($containerAttributes = []);
$inputAttributes = array_merge(['name' => $name, 'placeholder' => $placeholder, 'type' => $inputType, 'value' => $value, 'class' => $inputClass], $inputAttributes);
$containerAttributes = array_merge(['class' => $containerClass], $containerAttributes);
$labelAttributes = array_merge(['class' => $labelClass], $labelAttributes);
?>

<<?php 
echo $containerTag;
?>
 <?php 
echo Tag::renderAttributes($containerAttributes);
?>
>

<?php 
echo isset($label) ? new TagWithText('label', $label, $labelAttributes) . '&nbsp;' : '';
?>

<input <?php 
echo Tag::renderAttributes($inputAttributes);
?>
/>
<?php 
echo $component->renderChildren();
?>
</<?php 
echo $containerTag;
?>
>
Esempio n. 2
0
$labelAttributes = array_merge(['class' => $labelClass], $labelAttributes);
// support of auto-submitting form on value change
if (isset($autoSubmit) && $autoSubmit === true) {
    if (array_key_exists('onchange', $inputAttributes)) {
        $inputAttributes['onchange'] .= ';this.form.submit();';
    } else {
        $inputAttributes['onchange'] = 'this.form.submit()';
    }
}
?>

<<?php 
echo $containerTag;
?>
 <?php 
echo Tag::renderAttributes($containerAttributes);
?>
>

<?php 
echo isset($label) ? new TagWithText('label', $label, $labelAttributes) : '';
?>

<?php 
echo new Select($inputAttributes, $options, $value);
?>
</<?php 
echo $containerTag;
?>
>