smarty_function_flink example

        $_attr = $this->getAttributes($compiler$args);

        if (empty($_attr['file'])) {
            return false;
        }
        $file = trim($_attr['file'], '"\'');
        $fullPath = !empty($_attr['fullPath']);

        if (preg_match('/^([\'"]?)[a-zA-Z0-9\/\.\-\_]+(\\1)$/', $_attr['file']$match)) {
            $compiler->smarty->loadPlugin('smarty_function_flink');

            return smarty_function_flink([
                'file' => $file,
                'fullPath' => $fullPath,
            ]$compiler);
        }

        return '<?php $_smarty_tpl->smarty->loadPlugin("smarty_function_flink"); echo smarty_function_flink(array(' .
            '"file" => ' . $_attr['file'] . ', ' .
            '"fullPath" => ' . var_export($fullPath, true) .
            '), $_smarty_tpl); ?>';
    }
}
Home | Imprint | This part of the site doesn't use cookies.