protected function initCharacterCounter(&$options = [])
    {
        $showCharacterCounter = ArrayHelper::getValue($options, 'showCharacterCounter', false);

        if ($showCharacterCounter) {
            Html::addCssClass($this->inputOptions, ['character-counter' => 'has-character-counter']);
            $js = "M.CharacterCounter.init(document.querySelectorAll('.has-character-counter'))";
            $view = $this->form->getView();
            $view->registerJs($js);
        }
    }