input.checkbox.php
Поле «Флажок (да/нет)»
Вызывается из:
Смотрите описание Cms\Root\Form\Field\Checkbox
Исходный код
<?php
$attributes = $Field->getFieldInputAttributes(array(
'grid-margin' => $Field->getInputMargin(),
'grid-width' => $Field->getInputWidth(),
'class' => 'field-input field-input--checkbox',
));
print '<span';
foreach ($attributes as $attributeName => $attributeValue) if ($attributeValue !== null) print ' ' . $attributeName . '="' . $attributeValue . '"';
print '>';
print '<label class="input-label input-label--checkbox">';
$attributes = $Field->getInputAttributes(array(
'type' => 'checkbox',
'name' => $Field->name,
'value' => 'Y',
'checked' => $Field->value ? '' : null,
'placeholder' => strval($Field->placeholder) !== '' ? htmlspecialchars($Field->placeholder) : null,
'required' => $Field->required ? '' : null,
'disabled' => $Field->disabled ? '' : null,
'readonly' => $Field->readonly ? '' : null,
'class' => 'input--checkbox',
'id' => $Field->id('-input'),
'onclick' => $Field->readonly ? 'return false' : null,
));
print '<input';
foreach ($attributes as $attributeName => $attributeValue) if ($attributeValue !== null) print ' ' . $attributeName . '="' . $attributeValue . '"';
print '>';
if (strval($attributeValue = $Field->getAttribute('text')) !== '') {
print '<span class="label-text">' . $attributeValue . '</span>';
}
print '</label>';
print '</span>';
?>