Permalink
Browse files

[I] $modx->addSnippet('snippet name', function name')

[[#Snippet Name]]
$modx->addSnippet('Snippet Name', test');
function test($params) {
return 'abcde';
}
  • Loading branch information...
yama committed Jan 16, 2017
1 parent 2507532 commit 8e10ccd1e4dd2b8318747121f4c88cb843dc261c
Showing with 2 additions and 1 deletion.
  1. +2 −1 manager/includes/document.parser.class.inc.php
@@ -1821,7 +1821,8 @@ function evalSnippet($phpcode, $params) {
extract($params, EXTR_SKIP);
}
ob_start();
$return = eval($phpcode);
if(strpos($phpcode,';')!==false) $return = eval($phpcode);
else $return = call_user_func_array($phpcode,$params);
$echo = ob_get_contents();
ob_end_clean();

0 comments on commit 8e10ccd

Please sign in to comment.