PHP code example of imponeer / smarty-translate
1. Go to this page and download the library: Download imponeer/smarty-translate 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/ */
imponeer / smarty-translate example snippets
$smarty = new \Smarty();
$transBlockPlugin = new \Imponeer\Smarty\Extensions\Translate\TransBlock($translator);
$transModifierPlugin = new \Imponeer\Smarty\Extensions\Translate\TransVarModifier($translator);
$smarty->registerPlugin('block', $transBlockPlugin->getName(), [$transBlockPlugin, 'execute']);
$smarty->registerPlugin('modifier', $transModifierPlugin->getName(), [$transModifierPlugin, 'execute']);
smarty
<{"_AD_INSTALLEDMODULES"|trans:[]:'admin'}>