original_string: public function counter($options = [])
      {
          if (is_string($options)) {
              $options = ['format' => $options];
          }
  
          $options += [
              'model' => $this->defaultModel(),
              'format' => 'pages',
          ];
  
          $paging = $this->params($options['model']);
          if (!$paging['pageCount']) {
              $paging['pageCount'] = 1;
          }
  
          switch ($options['format']) {
              case 'range':
              case 'pages':
                  $template = 'counter' . ucfirst($options['format']);
                  break;
              default:
                  $template = 'counterCustom';
                  $this->templater()->add([$template => $options['format']]);
          }
          $map = array_map([$this->Number, 'format'], [
              'page' => $paging['page'],
              'pages' => $paging['pageCount'],
              'current' => $paging['current'],
              'count' => $paging['count'],
              'start' => $paging['start'],
              'end' => $paging['end']
          ]);
  
          $map += [
              'model' => strtolower(Inflector::humanize(Inflector::tableize($options['model'])))
          ];
  
          return $this->templater()->format($template, $map);
      }
code: public function counter($options = [])
      {
          if (is_string($options)) {
              $options = ['format' => $options];
          }
  
          $options += [
              'model' => $this->defaultModel(),
              'format' => 'pages',
          ];
  
          $paging = $this->params($options['model']);
          if (!$paging['pageCount']) {
              $paging['pageCount'] = 1;
          }
  
          switch ($options['format']) {
              case 'range':
              case 'pages':
                  $template = 'counter' . ucfirst($options['format']);
                  break;
              default:
                  $template = 'counterCustom';
                  $this->templater()->add([$template => $options['format']]);
          }
          $map = array_map([$this->Number, 'format'], [
              'page' => $paging['page'],
              'pages' => $paging['pageCount'],
              'current' => $paging['current'],
              'count' => $paging['count'],
              'start' => $paging['start'],
              'end' => $paging['end']
          ]);
  
          $map += [
              'model' => strtolower(Inflector::humanize(Inflector::tableize($options['model'])))
          ];
  
          return $this->templater()->format($template, $map);
      }
code_tokens: public function counter ( $ options = [ ] ) { if ( is_string ( $ options ) ) { $ options = [ 'format' => $ options ] ; } $ options += [ 'model' => $ this -> defaultModel ( ) , 'format' => 'pages' , ] ; $ paging = $ this -> params ( $ options [ 'model' ] ) ; if ( ! $ paging [ 'pageCount' ] ) { $ paging [ 'pageCount' ] = 1 ; } switch ( $ options [ 'format' ] ) { case 'range' : case 'pages' : $ template = 'counter' . ucfirst ( $ options [ 'format' ] ) ; break ; default : $ template = 'counterCustom' ; $ this -> templater ( ) -> add ( [ $ template => $ options [ 'format' ] ] ) ; } $ map = array_map ( [ $ this -> Number , 'format' ] , [ 'page' => $ paging [ 'page' ] , 'pages' => $ paging [ 'pageCount' ] , 'current' => $ paging [ 'current' ] , 'count' => $ paging [ 'count' ] , 'start' => $ paging [ 'start' ] , 'end' => $ paging [ 'end' ] ] ) ; $ map += [ 'model' => strtolower ( Inflector :: humanize ( Inflector :: tableize ( $ options [ 'model' ] ) ) ) ] ; return $ this -> templater ( ) -> format ( $ template , $ map ) ; }
docstring: Returns a counter string for the paged result set
  
  ### Options
  
  - `model` The model to use, defaults to PaginatorHelper::defaultModel();
  - `format` The format string you want to use, defaults to 'pages' Which generates output like '1 of 5'
  set to 'range' to generate output like '1 - 3 of 13'. Can also be set to a custom string, containing
  the following placeholders `{{page}}`, `{{pages}}`, `{{current}}`, `{{count}}`, `{{model}}`, `{{start}}`, `{{end}}` and any
  custom content you would like.
  
  @param string|array $options Options for the counter string. See #options for list of keys.
  If string it will be used as format.
  @return string Counter string.
  @link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-a-page-counter
docstring_tokens: Returns a counter string for the paged result set