Lines Matching refs:Twig
4 This is the documentation for Twig, the flexible, fast, and secure template
8 Smarty, Django, or Jinja, you should feel right at home with Twig. It's both
14 * *Fast*: Twig compiles templates down to plain optimized PHP code. The
17 * *Secure*: Twig has a sandbox mode to evaluate untrusted template code. This
18 allows Twig to be used as a template language for applications where users
21 * *Flexible*: Twig is powered by a flexible lexer and parser. This allows the
24 Twig is used by many Open-Source projects like Symfony, Drupal8, eZPublish,
31 Twig needs at least **PHP 5.2.7** to run. As of 1.34, the minimum requirement
37 The recommended way to install Twig is via Composer:
47 the Twig C extension.
52 This section gives you a brief introduction to the PHP API for Twig.
58 $loader = new \Twig\Loader\ArrayLoader([
61 $twig = new \Twig\Environment($loader);
65 Twig uses a loader (``\Twig\Loader\ArrayLoader``) to locate templates, and an
66 environment (``\Twig\Environment``) to store the configuration.
71 As templates are generally stored on the filesystem, Twig also comes with a
74 $loader = new \Twig\Loader\FilesystemLoader('/path/to/templates');
75 $twig = new \Twig\Environment($loader, [
83 If you are not using Composer, use the Twig built-in autoloader::
85 require_once '/path/to/lib/Twig/Autoloader.php';