<input type="text" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
- *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
- *}class="long"{*
+ *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}"{*
+ *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
*}{if $field->isAutofocused()} autofocus{/if}{*
*}{if $field->isRequired()} required{/if}{*
*}{if $field->isImmutable()} disabled{/if}{*
<input type="text" {*
*}id="{@$field->getPrefixedId()}" {*
*}name="{@$field->getPrefixedId()}" {*
- *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {*
- *}class="long"{*
+ *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}"{*
+ *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
*}{if $field->isAutofocused()} autofocus{/if}{*
*}{if $field->isRequired()} required{/if}{*
*}{if $field->isImmutable()} disabled{/if}{*
* @package WoltLabSuite\Core\System\Form\Builder\Field
* @since 5.2
*/
-class TextFormField extends AbstractFormField implements IAutoFocusFormField, II18nFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField {
+class TextFormField extends AbstractFormField implements IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField {
use TAutoFocusFormField;
+ use TCssClassFormField;
use TImmutableFormField;
use TI18nFormField {
validate as protected i18nValidate;
*/
protected $templateName = '__textFormField';
+ /**
+ * Creates a new instance of `TextFormField`.
+ */
+ public function __construct() {
+ $this->addFieldClass('long');
+ }
+
/**
* @inheritDoc
*/