+++ /dev/null
-<input type="text" {*
- *}id="{@$field->getPrefixedId()}" {*
- *}name="{@$field->getPrefixedId()}" {*
- *}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->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
- *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/if}{*
- *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
- *}{if $field->getPattern() !== null} pattern="{$field->getPattern()}"{/if}{*
- *}{if $field->isAutofocused()} autofocus{/if}{*
- *}{if $field->isRequired()} required{/if}{*
- *}{if $field->isImmutable()} disabled{/if}{*
- *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{*
- *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
- *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
- *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
-*}>
+++ /dev/null
-<input type="text" {*
- *}id="{@$field->getPrefixedId()}" {*
- *}name="{@$field->getPrefixedId()}" {*
- *}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->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{*
- *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/if}{*
- *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
- *}{if $field->getPattern() !== null} pattern="{$field->getPattern()}"{/if}{*
- *}{if $field->isAutofocused()} autofocus{/if}{*
- *}{if $field->isRequired()} required{/if}{*
- *}{if $field->isImmutable()} disabled{/if}{*
- *}{if $field->getMinimumLength() !== null} minlength="{$field->getMinimumLength()}"{/if}{*
- *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
- *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
- *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
-*}>
class CodeFormField extends TextFormField {
use TDefaultIdFormField;
- /**
- * @inheritDoc
- */
- protected $templateName = '__multifactorTotpCodeField';
-
/**
* @var ?int
*/
public function __construct() {
$this->minimumLength(Totp::CODE_LENGTH);
$this->maximumLength(Totp::CODE_LENGTH);
+ $this->fieldAttribute('size', Totp::CODE_LENGTH);
$this->addFieldClass('multifactorTotpCode');
$this->autoComplete('off');
$this->inputMode('numeric');