Add var_dump template function

This commit is contained in:
Benjamin Renard 2020-05-05 12:49:59 +02:00
parent 92f3d0be8e
commit edc625b85f

View file

@ -128,6 +128,7 @@ class LStemplate {
self :: registerFunction("img", "LStemplate_smarty_img"); self :: registerFunction("img", "LStemplate_smarty_img");
self :: registerFunction("css", "LStemplate_smarty_css"); self :: registerFunction("css", "LStemplate_smarty_css");
self :: registerFunction("uniqid", "LStemplate_smarty_uniqid"); self :: registerFunction("uniqid", "LStemplate_smarty_uniqid");
self :: registerFunction("var_dump", "LStemplate_smarty_var_dump");
// Define public root URL // Define public root URL
$public_root_url = LSconfig :: get('public_root_url', '/', 'string'); $public_root_url = LSconfig :: get('public_root_url', '/', 'string');
@ -473,6 +474,10 @@ function LStemplate_smarty_uniqid($params, &$smarty) {
$smarty -> assign($params['var'], uniqid()); $smarty -> assign($params['var'], uniqid());
} }
function LStemplate_smarty_var_dump($params, &$smarty) {
var_dump($params['data']);
}
// Errors // Errors
LSerror :: defineError('LStemplate_01', LSerror :: defineError('LStemplate_01',
_("LStemplate : Template %{file} not found.") _("LStemplate : Template %{file} not found.")