Fix the class name and a missing parenthesis in the runtime loader example

This commit is contained in:
Fabien Potencier
2026-09-25 23:53:01 +02:00
parent e883536e64
commit 1478f9efcd
+2 -2
View File
@@ -917,8 +917,8 @@ a runtime extension using one of the runtime loaders::
}
$twig = new \Twig\Environment($loader);
$twig->addExtension(new \Twig\Extension\AttributeExtension(ProjectExtension::class);
$twig->addRuntimeLoader(new \Twig\RuntimeLoader\FactoryLoader([
$twig->addExtension(new \Twig\Extension\AttributeExtension(ProjectExtension::class));
$twig->addRuntimeLoader(new \Twig\RuntimeLoader\FactoryRuntimeLoader([
ProjectExtension::class => function () use ($lipsumProvider) {
return new ProjectExtension($lipsumProvider);
},