Lines Matching refs:loader
106 * *Replacement*: If you use the filesystem loader, Twig loads the first
348 $twig = new \Twig\Environment($loader, [
399 recipe gives you a simple PDO template loader you can use as a starting point
418 Now, let's define a loader able to use this database::
479 $loader = new DatabaseTwigLoader($dbh);
480 $twig = new \Twig\Environment($loader);
490 sources, you need to use the ``\Twig\Loader\ChainLoader`` loader.
493 same way as we would have done it with a regular filesystem loader. This is
495 filesystem, or any other loader for that matter: the template name should be a
502 $loader = new \Twig\Loader\ChainLoader([$loader1, $loader2]);
504 $twig = new \Twig\Environment($loader);
508 Now that the ``base.twig`` templates is defined in an array loader, you can
530 Never use the ``Twig_Loader_String`` loader, which has severe limitations.