Environment

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

Base Twig template class.

View source (opens new window)

# Public Methods

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

# __construct()

View source (opens new window)

Arguments

  • $loader
  • $options

# compileSource()

View source (opens new window)

Arguments

  • $source

# getDefaultEscaperStrategy()

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

View source (opens new window)

Arguments

Returns

string (opens new window), false (opens new window)

# loadTemplate()

View source (opens new window)

Arguments

  • $name
  • $index

# setDefaultEscaperStrategy()

View source (opens new window)

Arguments

  • $strategy (mixed, null (opens new window)) โ€“ The escaper strategy to set. If null, it will be determined based on the template name.