1. Go to this page and download the library: Download ajur-media/template 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/ */
ajur-media / template example snippets
$SMARTY = new Smarty();
$SMARTY->setTemplateDir( __DIR__ );
$SMARTY->setCompileDir( __DIR__ . '/cache/');
$SMARTY->setForceCompile(true);
// Global + inner templates
$global = new \AJUR\Template($SMARTY, $_REQUEST);
$global->setTemplate('1.tpl');
$inner = new \AJUR\Template($SMARTY);
$inner->setTemplate("2.tpl");
$inner->assign('value_1', 'FOO');
$inner->assign('value_2', 'BAR');
$global->assign("content", $inner->render());
echo $global->render();
// Global + AR',
]);
$global->setRenderType(\AJUR\Template::CONTENT_TYPE_JSON);
echo $global->render();
{$size|size_format:decimals:separator:separator}
public static function size_format(int $size, int $decimals = 0, string $decimal_separator = '.', string $thousands_separator = ','):string;