public function Twig_Environment::initRuntime in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/twig/twig/lib/Twig/Environment.php \Twig_Environment::initRuntime()
Initializes the runtime environment.
Deprecated
since 1.23 (to be removed in 2.0)
1 call to Twig_Environment::initRuntime()
- Twig_Environment::loadTemplate in vendor/
twig/ twig/ lib/ Twig/ Environment.php - Loads a template by name.
File
- vendor/
twig/ twig/ lib/ Twig/ Environment.php, line 731
Class
- Twig_Environment
- Stores the Twig configuration.
Code
public function initRuntime() {
$this->runtimeInitialized = true;
foreach ($this
->getExtensions() as $name => $extension) {
if (!$extension instanceof Twig_Extension_InitRuntimeInterface) {
$m = new ReflectionMethod($extension, 'initRuntime');
if ('Twig_Extension' !== $m
->getDeclaringClass()
->getName()) {
@trigger_error(sprintf('Defining the initRuntime() method in the "%s" extension is deprecated. Use the `needs_environment` option to get the Twig_Environment instance in filters, functions, or tests; or explicitly implement Twig_Extension_InitRuntimeInterface if needed (not recommended).', $name), E_USER_DEPRECATED);
}
}
$extension
->initRuntime($this);
}
}