/**
 * Macro loader for Smarty.
 */
function smarty_function_loadmacro($params, &$smarty)
{
    if ($params['set'] == '') {
        $smarty->trigger_error("macro: missing attribute 'set' for the loadmacro");
        return;
    }
    $macroPath = PathManager::macroDir();
    $smarty->fetch($macroPath . $params['set'] . '.tpl');
}
 function __construct($runData = null)
 {
     $this->macroPath = PathManager::macroDir();
 }
Exemple #3
0
 public static function parseMacros()
 {
     $dir = PathManager::macroDir();
     $files = ls($dir, "*.autoload.tpl");
     foreach ($files as $f) {
         self::$smarty->fetch($dir . $f);
     }
 }