Skip to content

Environment ​

Type
Class
Namespace
craft\web\twig
Inherits
craft\web\twig\Environment » Twig\Environment
Since
3.0.0

Base Twig template class.

View source

Public Methods ​

MethodDescription
__construct()
compileSource()
getDefaultEscaperStrategy()Returns the default escaper strategy to use based on the template name.
setDefaultEscaperStrategy()

__construct() ​

View source

Arguments ​

  • $loader
  • $options

compileSource() ​

View source

Arguments ​

  • $source

getDefaultEscaperStrategy() ​

Returns the default escaper strategy to use based on the template name.

View source

Arguments ​

Returns ​

string, false

setDefaultEscaperStrategy() ​

View source

Arguments ​

  • $strategy (mixed) – The escaper strategy to set. If null, it will be determined based on the template name.