assets();
// Field Output
$field_output = $field->output($entity).$this->description($field);
$label_col = $this->columnSpan($field, 'label_col', $this->colFirst);
$field_col = $this->columnSpan($field, 'field_col', $this->colSecond);
if ($field->type() === Separator::TYPE || $field->type() === Agreement::TYPE)
{
$output .= Html::is_admin_context()
? '
'
: '';
}
else if ($field->type() === Wrapper::TYPE)
{
$output .= '';
}
else
{
$output .= Html::is_admin_context()
? ''.$this->label($field).$field_output.'
'
: '
'.$this->label($field).'
'.$field_output.'
';
}
}
return $output;
}
private function columnSpan(Field $field, string $key, int $default): int
{
$span = (int) $field->get($key);
if ($span < 1 || $span > 12) return $default;
return $span;
}
}