You are here

public function Twig_Environment::tokenize in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Environment.php \Twig_Environment::tokenize()

Tokenizes a source code.

Parameters

string $source The template source code:

string $name The template name:

Return value

Twig_TokenStream A Twig_TokenStream instance

Throws

Twig_Error_Syntax When the code is syntactically wrong

1 call to Twig_Environment::tokenize()
Twig_Environment::compileSource in vendor/Twig/Environment.php
Compiles a template source code.

File

vendor/Twig/Environment.php, line 467

Class

Twig_Environment
Stores the Twig configuration.

Code

public function tokenize($source, $name = null) {
  return $this
    ->getLexer()
    ->tokenize($source, $name);
}