메소드 | 설명 | |
---|---|---|
__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. |
메소드 | 설명 | |
---|---|---|
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 disableStrictVariables ( ) |
public enableStrictVariables ( ) |
public getBaseTemplateClass ( ) : string | ||
리턴 | string | The base template class name |
public getBinaryOperators ( ) : array | ||
리턴 | array | An array of binary operators |
public getCacheFilename ( string $name ) : string | ||
$name | string | The template name |
리턴 | string | The cache file name |
public getCharset ( ) : string | ||
리턴 | string | The default charset |
public getCompiler ( ) : Twig_CompilerInterface | ||
리턴 | Twig_CompilerInterface | A Twig_CompilerInterface instance |
public getExtension ( string $name ) : Twig_ExtensionInterface | ||
$name | string | The extension name |
리턴 | Twig_ExtensionInterface | A Twig_ExtensionInterface instance |
public getExtensions ( ) : array | ||
리턴 | array | An array of extensions |
public getFunction ( string $name ) : Twig_Function | false | ||
$name | string | function name |
리턴 | Twig_Function | false | A Twig_Function instance or false if the function does not exists |
public getGlobals ( ) : array | ||
리턴 | array | An array of globals |
public getLexer ( ) : Twig_LexerInterface | ||
리턴 | Twig_LexerInterface | A Twig_LexerInterface instance |
public getLoader ( ) : Twig_LoaderInterface | ||
리턴 | Twig_LoaderInterface | A Twig_LoaderInterface instance |
public getNodeVisitors ( ) : Twig_NodeVisitorInterface[] | ||
리턴 | Twig_NodeVisitorInterface[] | An array of Twig_NodeVisitorInterface instances |
public getParser ( ) : Twig_ParserInterface | ||
리턴 | Twig_ParserInterface | A Twig_ParserInterface instance |
public getTemplateClass ( string $name ) : string | ||
$name | string | The name for which to calculate the template class name |
리턴 | string | The template class name |
public getTemplateClassPrefix ( ) : string | ||
리턴 | string | The template class prefix |
public getTests ( ) : Twig_TestInterface[] | ||
리턴 | Twig_TestInterface[] | An array of Twig_TestInterface instances |
public getTokenParsers ( ) : Twig_TokenParserInterface[] | ||
리턴 | Twig_TokenParserInterface[] | An array of Twig_TokenParserInterface instances |
public getUnaryOperators ( ) : array | ||
리턴 | array | An array of unary operators |
public hasExtension ( string $name ) : boolean | ||
$name | string | The extension name |
리턴 | boolean | Whether the extension is registered or not |
public isAutoReload ( ) : boolean | ||
리턴 | boolean | true if auto_reload is enabled, false otherwise |
public isStrictVariables ( ) : boolean | ||
리턴 | boolean | true if strict_variables is enabled, false otherwise |
protected loadFilters ( ) : Twig_FilterInterface[] | ||
리턴 | Twig_FilterInterface[] | An array of Twig_FilterInterface instances |
public loadTemplate ( string $name ) : Twig_TemplateInterface | ||
$name | string | The template name |
리턴 | 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 |
리턴 | Twig_Node_Module | A Node tree |
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 |