PHP code example of uam / twig-i18n-extension

1. Go to this page and download the library: Download uam/twig-i18n-extension library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

uam / twig-i18n-extension example snippets

 bash
$ php composer.phar update
 php
use UAM\Twig\Extension\I18n\I18nExtension;

$twig = new Twig_Environment(...);

$twig->addExtension(new I18nExtension());
 php
# app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new UAM\Twig\Extension\I18n\Bridge\Symfony\UAMTwigI18nBundle(),
            ...
        );