[-] PROJECT : You can now execute hook in the tpl
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10932 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -58,6 +58,7 @@ smartyRegisterFunction($smarty, 'function', 'm', 'smartyMaxWords'); // unused
|
||||
smartyRegisterFunction($smarty, 'function', 'p', 'smartyShowObject'); // Debug only
|
||||
smartyRegisterFunction($smarty, 'function', 'd', 'smartyDieObject'); // Debug only
|
||||
smartyRegisterFunction($smarty, 'function', 'l', 'smartyTranslate');
|
||||
smartyRegisterFunction($smarty, 'function', 'hook', 'smartyHook');
|
||||
|
||||
smartyRegisterFunction($smarty, 'function', 'dateFormat', array('Tools', 'dateFormat'));
|
||||
smartyRegisterFunction($smarty, 'function', 'convertPrice', array('Product', 'convertPrice'));
|
||||
@@ -143,3 +144,9 @@ function smartyRegisterFunction($smarty, $type, $function, $params)
|
||||
return false;
|
||||
$smarty->registerPlugin($type, $function, $params);
|
||||
}
|
||||
|
||||
function smartyHook($params, &$smarty)
|
||||
{
|
||||
if (isset($params['h']) && !empty($params['h']))
|
||||
return Hook::exec($params['h']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user