PHP code example of alaczi / twig-locale-name-extension
1. Go to this page and download the library: Download alaczi/twig-locale-name-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/ */
alaczi / twig-locale-name-extension example snippets
$filter = new \alaczi\Twig\Extension\LocaleNameExtension();
$twig = new Twig_Environment($loader);
$twig->addFilter($filter);
$app['twig'] = $app->share($app->extend('twig', function ($twig, $app) {
/** @var \Twig_Environment $twig */
$twig->addExtension(new \alaczi\Twig\Extension\LocaleNameExtension())
return $twig;
}));