Method | Description | |
---|---|---|
__construct ( Twig_LoaderInterface $loader = null, array $options = [] ) | Constructor. | |
__construct ( Twig_LoaderInterface $loader = null, array $options = [], Twig_LexerInterface $lexer = null, Twig_ParserInterface $parser = null, Twig_CompilerInterface $compiler = null ) | Constructor. | |
addExtension ( Twig_ExtensionInterface $extension ) | Registers an extension. | |
addFilter ( $name, Twig_FilterInterface $filter ) | ||
addFilter ( string $name, Twig_FilterInterface $filter ) | Registers a Filter. | |
addFunction ( string $name, Twig_FunctionInterface $function ) | Registers a Function. | |
addGlobal ( string $name, mixed $value ) | Registers a Global. | |
addNodeVisitor ( Twig_NodeVisitorInterface $visitor ) | Registers a Node Visitor. | |
addTest ( $name, Twig_TestInterface $test ) | ||
addTest ( string $name, Twig_TestInterface $test ) | Registers a Test. | |
addTokenParser ( Twig_TokenParserInterface $parser ) | Registers a Token Parser. | |
clearCacheFiles ( ) | Clears the template cache files on the filesystem. | |
clearTemplateCache ( ) | Clears the internal template cache. | |
compile ( Twig_NodeInterface $node ) | ||
compile ( Twig_NodeInterface $node ) : string | Compiles a Node. | |
compileSource ( $source, $name ) | ||
compileSource ( string $source, string $name = null ) : string | Compiles a template source code. | |
disableAutoReload ( ) | Disables the auto_reload option. | |
disableDebug ( ) | Disables debugging mode. | |
disableStrictVariables ( ) | Disables the strict_variables option. | |
enableAutoReload ( ) | Enables the auto_reload option. | |
enableDebug ( ) | Enables debugging mode. | |
enableStrictVariables ( ) | Enables the strict_variables option. | |
getBaseTemplateClass ( ) | ||
getBaseTemplateClass ( ) : string | Gets the base template class for compiled templates. | |
getBinaryOperators ( ) | ||
getBinaryOperators ( ) : array | Gets the registered binary Operators. | |
getCache ( ) | ||
getCache ( ) : string | false | Gets the cache directory or false if cache is disabled. | |
getCacheFilename ( $name ) | ||
getCacheFilename ( string $name ) : string | Gets the cache filename for a given template. | |
getCharset ( ) | ||
getCharset ( ) : string | Gets the default template charset. | |
getCompiler ( ) | ||
getCompiler ( ) : Twig_CompilerInterface | Gets the Compiler instance. | |
getExtension ( $name ) | ||
getExtension ( string $name ) : Twig_ExtensionInterface | Gets an extension by name. | |
getExtensions ( ) | ||
getExtensions ( ) : array | Returns all registered extensions. | |
getFilter ( string $name ) : Twig_Filter | false | Get a filter by name. | |
getFilters ( ) | ||
getFunction ( string $name ) : Twig_Function | false | Get a function by name. | |
getGlobals ( ) : array | Gets the registered Globals. | |
getLexer ( ) | ||
getLexer ( ) : Twig_LexerInterface | Gets the Lexer instance. | |
getLoader ( ) | ||
getLoader ( ) : Twig_LoaderInterface | Gets the Loader instance. | |
getNodeVisitors ( ) | ||
getNodeVisitors ( ) : Twig_NodeVisitorInterface[] | Gets the registered Node Visitors. | |
getParser ( ) | ||
getParser ( ) : Twig_ParserInterface | Gets the Parser instance. | |
getTemplateClass ( string $name ) : string | Gets the template class associated with the given string. | |
getTemplateClassPrefix ( ) : string | Gets the template class prefix. | |
getTests ( ) | ||
getTests ( ) : Twig_TestInterface[] | Gets the registered Tests. | |
getTokenParsers ( ) | ||
getTokenParsers ( ) : Twig_TokenParserInterface[] | Gets the registered Token Parsers. | |
getUnaryOperators ( ) | ||
getUnaryOperators ( ) : array | Gets the registered unary Operators. | |
hasExtension ( $name ) | ||
hasExtension ( string $name ) : boolean | Returns true if the given extension is registered. | |
initRuntime ( ) | Initializes the runtime environment. | |
isAutoReload ( ) | ||
isAutoReload ( ) : boolean | Checks if the auto_reload option is enabled. | |
isDebug ( ) | ||
isDebug ( ) : boolean | Checks if debug mode is enabled. | |
isStrictVariables ( ) | ||
isStrictVariables ( ) : boolean | Checks if the strict_variables option is enabled. | |
loadTemplate ( string $name ) : Twig_TemplateInterface | Loads a template by name. | |
parse ( Twig_TokenStream $tokens ) | ||
parse ( Twig_TokenStream $tokens ) : Twig_Node_Module | Parses a token stream. | |
registerUndefinedFilterCallback ( $callable ) | ||
registerUndefinedFunctionCallback ( $callable ) | ||
removeExtension ( $name ) | ||
removeExtension ( string $name ) | Removes an extension by name. | |
render ( string $name, array $context = [] ) : string | Renders a template. | |
setAutoReload ( $autoReload ) | ||
setBaseTemplateClass ( $class ) | ||
setBaseTemplateClass ( string $class ) | Sets the base template class for compiled templates. | |
setCache ( $cache ) | ||
setCache ( string | false $cache ) | Sets the cache directory or false if cache is disabled. | |
setCharset ( $charset ) | ||
setCharset ( string $charset ) | Sets the default template charset. | |
setCompiler ( Twig_CompilerInterface $compiler ) | Sets the Compiler instance. | |
setExtensions ( array $extensions ) | Registers an array of extensions. | |
setLexer ( Twig_LexerInterface $lexer ) | Sets the Lexer instance. | |
setLoader ( Twig_LoaderInterface $loader ) | Sets the Loader instance. | |
setParser ( Twig_ParserInterface $parser ) | Sets the Parser instance. | |
tokenize ( $source, $name ) | ||
tokenize ( string $source, string $name = null ) : Twig_TokenStream | Tokenizes a source code. |
Method | Description | |
---|---|---|
initOperators ( ) | ||
loadFilters ( ) : Twig_FilterInterface[] | Gets the registered Filters. | |
loadFunctions ( ) | ||
writeCacheFile ( $file, $content ) |
public __construct ( Twig_LoaderInterface $loader = null, array $options = [] ) | ||
$loader | Twig_LoaderInterface | A Twig_LoaderInterface instance |
$options | array | An array of options |
public __construct ( Twig_LoaderInterface $loader = null, array $options = [], Twig_LexerInterface $lexer = null, Twig_ParserInterface $parser = null, Twig_CompilerInterface $compiler = null ) | ||
$loader | Twig_LoaderInterface | A Twig_LoaderInterface instance |
$options | array | An array of options |
$lexer | Twig_LexerInterface | A Twig_LexerInterface instance |
$parser | Twig_ParserInterface | A Twig_ParserInterface instance |
$compiler | Twig_CompilerInterface | A Twig_CompilerInterface instance |
public addExtension ( Twig_ExtensionInterface $extension ) | ||
$extension | Twig_ExtensionInterface | A Twig_ExtensionInterface instance |
public addFilter ( $name, Twig_FilterInterface $filter ) | ||
$filter | Twig_FilterInterface |
public addFunction ( string $name, Twig_FunctionInterface $function ) | ||
$name | string | The function name |
$function | Twig_FunctionInterface | A Twig_FunctionInterface instance |
public addNodeVisitor ( Twig_NodeVisitorInterface $visitor ) | ||
$visitor | Twig_NodeVisitorInterface | A Twig_NodeVisitorInterface instance |
public addTokenParser ( Twig_TokenParserInterface $parser ) | ||
$parser | Twig_TokenParserInterface | A Twig_TokenParserInterface instance |
public clearCacheFiles ( ) |
public clearTemplateCache ( ) |
public disableStrictVariables ( ) |
public enableStrictVariables ( ) |
public getBaseTemplateClass ( ) : string | ||
return | string | The base template class name |
public getBinaryOperators ( ) : array | ||
return | array | An array of binary operators |
public getCacheFilename ( string $name ) : string | ||
$name | string | The template name |
return | string | The cache file name |
public getCharset ( ) : string | ||
return | string | The default charset |
public getCompiler ( ) : Twig_CompilerInterface | ||
return | Twig_CompilerInterface | A Twig_CompilerInterface instance |
public getExtension ( string $name ) : Twig_ExtensionInterface | ||
$name | string | The extension name |
return | Twig_ExtensionInterface | A Twig_ExtensionInterface instance |
public getExtensions ( ) : array | ||
return | array | An array of extensions |
public getFunction ( string $name ) : Twig_Function | false | ||
$name | string | function name |
return | Twig_Function | false | A Twig_Function instance or false if the function does not exists |
public getGlobals ( ) : array | ||
return | array | An array of globals |
public getLexer ( ) : Twig_LexerInterface | ||
return | Twig_LexerInterface | A Twig_LexerInterface instance |
public getLoader ( ) : Twig_LoaderInterface | ||
return | Twig_LoaderInterface | A Twig_LoaderInterface instance |
public getNodeVisitors ( ) : Twig_NodeVisitorInterface[] | ||
return | Twig_NodeVisitorInterface[] | An array of Twig_NodeVisitorInterface instances |
public getParser ( ) : Twig_ParserInterface | ||
return | Twig_ParserInterface | A Twig_ParserInterface instance |
public getTemplateClass ( string $name ) : string | ||
$name | string | The name for which to calculate the template class name |
return | string | The template class name |
public getTemplateClassPrefix ( ) : string | ||
return | string | The template class prefix |
public getTests ( ) : Twig_TestInterface[] | ||
return | Twig_TestInterface[] | An array of Twig_TestInterface instances |
public getTokenParsers ( ) : Twig_TokenParserInterface[] | ||
return | Twig_TokenParserInterface[] | An array of Twig_TokenParserInterface instances |
public getUnaryOperators ( ) : array | ||
return | array | An array of unary operators |
public hasExtension ( string $name ) : boolean | ||
$name | string | The extension name |
return | boolean | Whether the extension is registered or not |
public isAutoReload ( ) : boolean | ||
return | boolean | true if auto_reload is enabled, false otherwise |
public isStrictVariables ( ) : boolean | ||
return | boolean | true if strict_variables is enabled, false otherwise |
protected loadFilters ( ) : Twig_FilterInterface[] | ||
return | Twig_FilterInterface[] | An array of Twig_FilterInterface instances |
public loadTemplate ( string $name ) : Twig_TemplateInterface | ||
$name | string | The template name |
return | Twig_TemplateInterface | A template instance representing the given template name |
public parse ( Twig_TokenStream $tokens ) : Twig_Node_Module | ||
$tokens | Twig_TokenStream | A Twig_TokenStream instance |
return | Twig_Node_Module | A Node tree |
public registerUndefinedFilterCallback ( $callable ) |
public registerUndefinedFunctionCallback ( $callable ) |
public removeExtension ( string $name ) | ||
$name | string | The extension name |
public setBaseTemplateClass ( string $class ) | ||
$class | string | The base template class name |
public setCharset ( string $charset ) | ||
$charset | string | The default charset |
public setCompiler ( Twig_CompilerInterface $compiler ) | ||
$compiler | Twig_CompilerInterface | A Twig_CompilerInterface instance |
public setExtensions ( array $extensions ) | ||
$extensions | array | An array of extensions |
public setLexer ( Twig_LexerInterface $lexer ) | ||
$lexer | Twig_LexerInterface |
public setLoader ( Twig_LoaderInterface $loader ) | ||
$loader | Twig_LoaderInterface | A Twig_LoaderInterface instance |
public setParser ( Twig_ParserInterface $parser ) | ||
$parser | Twig_ParserInterface |