[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.147.193.1: ~ $
Introduction
============

Welcome to the documentation for Twig, the flexible, fast, and secure template
engine for PHP.

Twig is both designer and developer friendly by sticking to PHP's principles and
adding functionality useful for templating environments.

The key-features are...

* *Fast*: Twig compiles templates down to plain optimized PHP code. The
  overhead compared to regular PHP code was reduced to the very minimum.

* *Secure*: Twig has a sandbox mode to evaluate untrusted template code. This
  allows Twig to be used as a template language for applications where users
  may modify the template design.

* *Flexible*: Twig is powered by a flexible lexer and parser. This allows the
  developer to define their own custom tags and filters, and to create their own DSL.

Twig is used by many Open-Source projects like Symfony, Drupal8, eZPublish,
phpBB, Matomo, OroCRM; and many frameworks have support for it as well like
Slim, Yii, Laravel, and Codeigniter — just to name a few.

Prerequisites
-------------

Twig needs at least **PHP 5.5.0** to run.

Installation
------------

The recommended way to install Twig is via Composer:

.. code-block:: bash

    composer require "twig/twig:^1.0"

.. note::

    To learn more about the other installation methods, read the
    :doc:`installation<installation>` chapter; it also explains how to install
    the Twig C extension.

Basic API Usage
---------------

This section gives you a brief introduction to the PHP API for Twig.

.. code-block:: php

    require_once '/path/to/vendor/autoload.php';

    $loader = new \Twig\Loader\ArrayLoader([
        'index' => 'Hello {{ name }}!',
    ]);
    $twig = new \Twig\Environment($loader);

    echo $twig->render('index', ['name' => 'Fabien']);

Twig uses a loader (``\Twig\Loader\ArrayLoader``) to locate templates, and an
environment (``\Twig\Environment``) to store its configuration.

The ``render()`` method loads the template passed as a first argument and
renders it with the variables passed as a second argument.

As templates are generally stored on the filesystem, Twig also comes with a
filesystem loader::

    $loader = new \Twig\Loader\FilesystemLoader('/path/to/templates');
    $twig = new \Twig\Environment($loader, [
        'cache' => '/path/to/compilation_cache',
    ]);

    echo $twig->render('index.html', ['name' => 'Fabien']);

Filemanager

Name Type Size Permission Actions
filters Folder 0755
functions Folder 0755
tags Folder 0755
tests Folder 0755
advanced.rst File 28.96 KB 0644
advanced_legacy.rst File 26.38 KB 0644
api.rst File 19.71 KB 0644
coding_standards.rst File 2.32 KB 0644
deprecated.rst File 8.05 KB 0644
index.rst File 235 B 0644
installation.rst File 2.15 KB 0644
internals.rst File 4.57 KB 0644
intro.rst File 2.32 KB 0644
recipes.rst File 18.5 KB 0644
templates.rst File 25.74 KB 0644