protected function _inputLabel($fieldName, $label, $options)
{
$options += ['id' => null, 'input' => null, 'nestedInput' => false, 'templateVars' => []];
$labelAttributes = ['templateVars' => $options['templateVars']];
if (is_array($label)) {
$labelText = null;
if (isset($label['text'])) {
$labelText = $label['text'];
unset($label['text']);
}
$labelAttributes = array_merge($labelAttributes, $label);
} else {
$labelText = $label;
}
$labelAttributes['for'] = $options['id'];
$groupTypes = ['radio', 'multicheckbox', 'date', 'time', 'datetime'];
if (in_array($options['type'], $groupTypes, true)) {
$labelAttributes['for'] = false;
}
if ($options['nestedInput']) {
$labelAttributes['input'] = $options['input'];
}
if (isset($options['escape'])) {
$labelAttributes['escape'] = $options['escape'];
}
return $this->label($fieldName, $labelText, $labelAttributes);
}