[ Index ]

PHP Cross Reference of phpBB-3.3.2-deutsch

title

Body

[close]

/vendor/twig/twig/src/ -> Environment.php (summary)

(no description)

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

Defines 1 class

Environment:: (63 methods):
  __construct()
  getBaseTemplateClass()
  setBaseTemplateClass()
  enableDebug()
  disableDebug()
  isDebug()
  enableAutoReload()
  disableAutoReload()
  isAutoReload()
  enableStrictVariables()
  disableStrictVariables()
  isStrictVariables()
  getCache()
  setCache()
  getTemplateClass()
  render()
  display()
  load()
  loadTemplate()
  loadClass()
  createTemplate()
  isTemplateFresh()
  resolveTemplate()
  setLexer()
  tokenize()
  setParser()
  parse()
  setCompiler()
  compile()
  compileSource()
  setLoader()
  getLoader()
  setCharset()
  getCharset()
  hasExtension()
  addRuntimeLoader()
  getExtension()
  getRuntime()
  addExtension()
  setExtensions()
  getExtensions()
  addTokenParser()
  getTokenParsers()
  getTags()
  addNodeVisitor()
  getNodeVisitors()
  addFilter()
  getFilter()
  registerUndefinedFilterCallback()
  getFilters()
  addTest()
  getTests()
  getTest()
  addFunction()
  getFunction()
  registerUndefinedFunctionCallback()
  getFunctions()
  addGlobal()
  getGlobals()
  mergeGlobals()
  getUnaryOperators()
  getBinaryOperators()
  updateOptionsHash()


Class: Environment  - X-Ref

Stores the Twig configuration and renders templates.

__construct(LoaderInterface $loader, $options = [])   X-Ref
Constructor.

Available options:

* debug: When set to true, it automatically set "auto_reload" to true as
well (default to false).

* charset: The charset used by the templates (default to UTF-8).

* base_template_class: The base template class to use for generated
templates (default to \Twig\Template).

* cache: An absolute path where to store the compiled templates,
a \Twig\Cache\CacheInterface implementation,
or false to disable compilation cache (default).

* auto_reload: Whether to reload the template if the original source changed.
If you don't provide the auto_reload option, it will be
determined automatically based on the debug value.

* strict_variables: Whether to ignore invalid variables in templates
(default to false).

* autoescape: Whether to enable auto-escaping (default to html):
* false: disable auto-escaping
* html, js: set the autoescaping to one of the supported strategies
* name: set the autoescaping strategy based on the template name extension
* PHP callback: a PHP callback that returns an escaping strategy based on the template "name"

* optimizations: A flag that indicates which optimizations to apply
(default to -1 which means that all optimizations are enabled;
set it to 0 to disable).

getBaseTemplateClass()   X-Ref
Gets the base template class for compiled templates.

return: string The base template class name

setBaseTemplateClass($class)   X-Ref
Sets the base template class for compiled templates.

param: string $class The base template class name

enableDebug()   X-Ref
Enables debugging mode.


disableDebug()   X-Ref
Disables debugging mode.


isDebug()   X-Ref
Checks if debug mode is enabled.

return: bool true if debug mode is enabled, false otherwise

enableAutoReload()   X-Ref
Enables the auto_reload option.


disableAutoReload()   X-Ref
Disables the auto_reload option.


isAutoReload()   X-Ref
Checks if the auto_reload option is enabled.

return: bool true if auto_reload is enabled, false otherwise

enableStrictVariables()   X-Ref
Enables the strict_variables option.


disableStrictVariables()   X-Ref
Disables the strict_variables option.


isStrictVariables()   X-Ref
Checks if the strict_variables option is enabled.

return: bool true if strict_variables is enabled, false otherwise

getCache($original = true)   X-Ref
Gets the current cache implementation.

param: bool $original Whether to return the original cache option or the real cache instance
return: CacheInterface|string|false A Twig\Cache\CacheInterface implementation,

setCache($cache)   X-Ref
Sets the current cache implementation.

param: CacheInterface|string|false $cache A Twig\Cache\CacheInterface implementation,

getTemplateClass($name, $index = null)   X-Ref
Gets the template class associated with the given string.

The generated template class is based on the following parameters:

* The cache key for the given template;
* The currently enabled extensions;
* Whether the Twig C extension is available or not;
* PHP version;
* Twig version;
* Options with what environment was created.

param: string   $name  The name for which to calculate the template class name
param: int|null $index The index if it is an embedded template
return: string The template class name

render($name, array $context = [])   X-Ref
Renders a template.

param: string|TemplateWrapper $name    The template name
param: array                  $context An array of parameters to pass to the template
return: string The rendered template

display($name, array $context = [])   X-Ref
Displays a template.

param: string|TemplateWrapper $name    The template name
param: array                  $context An array of parameters to pass to the template

load($name)   X-Ref
Loads a template.

param: string|TemplateWrapper $name The template name
return: TemplateWrapper

loadTemplate($name, $index = null)   X-Ref
Loads a template internal representation.

This method is for internal use only and should never be called
directly.

param: string $name  The template name
param: int    $index The index if it is an embedded template
return: Template A template instance representing the given template name

loadClass($cls, $name, $index = null)   X-Ref


createTemplate($template, string $name = null)   X-Ref
Creates a template from source.

This method should not be used as a generic way to load templates.

param: string $template The template source
param: string $name     An optional name of the template to be used in error messages
return: TemplateWrapper A template instance representing the given template name

isTemplateFresh($name, $time)   X-Ref
Returns true if the template is still fresh.

Besides checking the loader for freshness information,
this method also checks if the enabled extensions have
not changed.

param: string $name The template name
param: int    $time The last modification time of the cached template
return: bool true if the template is fresh, false otherwise

resolveTemplate($names)   X-Ref
Tries to load a template consecutively from an array.

Similar to load() but it also accepts instances of \Twig\Template and
\Twig\TemplateWrapper, and an array of templates where each is tried to be loaded.

param: string|TemplateWrapper|array $names A template or an array of templates to try consecutively
return: TemplateWrapper|Template

setLexer(Lexer $lexer)   X-Ref
No description

tokenize(Source $source)   X-Ref
Tokenizes a source code.

return: TokenStream

setParser(Parser $parser)   X-Ref
No description

parse(TokenStream $stream)   X-Ref
Converts a token stream to a node tree.

return: ModuleNode

setCompiler(Compiler $compiler)   X-Ref
No description

compile(Node $node)   X-Ref
Compiles a node and returns the PHP code.

return: string The compiled PHP source code

compileSource(Source $source)   X-Ref
Compiles a template source code.

return: string The compiled PHP source code

setLoader(LoaderInterface $loader)   X-Ref
No description

getLoader()   X-Ref
Gets the Loader instance.

return: LoaderInterface

setCharset($charset)   X-Ref
Sets the default template charset.

param: string $charset The default charset

getCharset()   X-Ref
Gets the default template charset.

return: string The default charset

hasExtension($class)   X-Ref
Returns true if the given extension is registered.

param: string $class The extension class name
return: bool Whether the extension is registered or not

addRuntimeLoader(RuntimeLoaderInterface $loader)   X-Ref
Adds a runtime loader.


getExtension($class)   X-Ref
Gets an extension by class name.

param: string $class The extension class name
return: ExtensionInterface

getRuntime($class)   X-Ref
Returns the runtime implementation of a Twig element (filter/function/test).

param: string $class A runtime class name
return: object The runtime implementation

addExtension(ExtensionInterface $extension)   X-Ref
No description

setExtensions(array $extensions)   X-Ref
Registers an array of extensions.

param: array $extensions An array of extensions

getExtensions()   X-Ref
Returns all registered extensions.

return: ExtensionInterface[] An array of extensions (keys are for internal usage only and should not be relied on)

addTokenParser(TokenParserInterface $parser)   X-Ref
No description

getTokenParsers()   X-Ref
Gets the registered Token Parsers.

return: TokenParserInterface[]

getTags()   X-Ref
Gets registered tags.

return: TokenParserInterface[]

addNodeVisitor(NodeVisitorInterface $visitor)   X-Ref
No description

getNodeVisitors()   X-Ref
Gets the registered Node Visitors.

return: NodeVisitorInterface[]

addFilter(TwigFilter $filter)   X-Ref
No description

getFilter($name)   X-Ref
Get a filter by name.

Subclasses may override this method and load filters differently;
so no list of filters is available.

param: string $name The filter name
return: TwigFilter|false

registerUndefinedFilterCallback(callable $callable)   X-Ref
No description

getFilters()   X-Ref
Gets the registered Filters.

Be warned that this method cannot return filters defined with registerUndefinedFilterCallback.

return: TwigFilter[]

addTest(TwigTest $test)   X-Ref
No description

getTests()   X-Ref
Gets the registered Tests.

return: TwigTest[]

getTest($name)   X-Ref
Gets a test by name.

param: string $name The test name
return: TwigTest|false

addFunction(TwigFunction $function)   X-Ref
No description

getFunction($name)   X-Ref
Get a function by name.

Subclasses may override this method and load functions differently;
so no list of functions is available.

param: string $name function name
return: TwigFunction|false

registerUndefinedFunctionCallback(callable $callable)   X-Ref
No description

getFunctions()   X-Ref
Gets registered functions.

Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback.

return: TwigFunction[]

addGlobal($name, $value)   X-Ref
Registers a Global.

New globals can be added before compiling or rendering a template;
but after, you can only update existing globals.

param: string $name  The global name
param: mixed  $value The global value

getGlobals()   X-Ref
Gets the registered Globals.

return: array An array of globals

mergeGlobals(array $context)   X-Ref
Merges a context with the defined globals.

param: array $context An array representing the context
return: array The context merged with the globals

getUnaryOperators()   X-Ref
Gets the registered unary Operators.

return: array An array of unary operators

getBinaryOperators()   X-Ref
Gets the registered binary Operators.

return: array An array of binary operators

updateOptionsHash()   X-Ref
No description



Generated: Wed Nov 11 20:28:18 2020 Cross-referenced by PHPXref 0.7.1