PHP code example of wilycode / template-translation
1. Go to this page and download the library: Download wilycode/template-translation 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/ */
wilycode / template-translation example snippets
use WilyCode\Template\Extension\TemplateTranslationExtension;
$engine->addExtension(new TemplateTranslationExtension(
translator: $translator,
defaultResource: 'messages',
formatter: $localeFormatter, // Optional: omit when locale formatting is not needed
));
$engine->addExtension(new TemplateTranslationExtension(
translator: $translator,
router: $router, // Optional WilyCode\Router\Router
));