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);
        }
    }
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);
        }
    }
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 ) ; } }
Initializes the Materialize character counter feature.

@param array $options the tag options as name-value-pairs.

@see https://materializecss.com/text-inputs.html#character-counter
Initializes the Materialize character counter feature .