input text field size

Is there no easy way to change the size of an individual text field without overriding the input/text.php file in my plugin?  I'm using Elgg 2.3.14.

echo elgg_view_field([
        '#type' => 'text',
        'name' => 'confirmCode',
        'autofocus' => true,
        'required' => true,
        '#label' => elgg_echo('confirmCode'),
        '#class' => 'link-account',
    ]);

I just want to set the size and maxlength of this one field to 6 but adding those properties didn't work.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking