Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

(no description)

File Size: 342 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Mustache_Tokenizer:: (6 methods):
  scan()
  reset()
  flushBuffer()
  changeDelimiters()
  setDelimiters()
  addPragma()


Class: Mustache_Tokenizer  - X-Ref

Mustache Tokenizer class.

This class is responsible for turning raw template source into a set of Mustache tokens.
scan($text, $delimiters = null)   X-Ref
Scan and tokenize template source.

param: string $text       Mustache template source to tokenize
param: string $delimiters Optionally, pass initial opening and closing delimiters (default: null)
return: array Set of Mustache tokens

reset()   X-Ref
Helper function to reset tokenizer internal state.


flushBuffer()   X-Ref
Flush the current buffer to a token.


changeDelimiters($text, $index)   X-Ref
Change the current Mustache delimiters. Set new `otag` and `ctag` values.

param: string $text  Mustache template source
param: int    $index Current tokenizer index
return: int New index value

setDelimiters($delimiters)   X-Ref
Set the current Mustache `otag` and `ctag` delimiters.

param: string $delimiters

addPragma($text, $index)   X-Ref
Add pragma token.

Pragmas are hoisted to the front of the template, so all pragma tokens
will appear at the front of the token list.

param: string $text
param: int    $index
return: int New index value