original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: 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
docstring_tokens: Initializes the Materialize character counter feature .