I have created a simple custom snippet which contains two functions.
When I call the functions from within the snippet I get a blank page. Annoyingly, I can't get any relevant errors, either in a file via MODx or Plesk, or output errors either. Just a blank page.
I trimmed this down to the smallest snippet which reproduces the issue:
$return = "TEST-";
$return .= test();
return $return;
if (!function_exists('test')) {
function test() {
return "test";
}
}
If I comment out line 2 I get the output "TEST-".
If I don't, I get a blank page.
Can anyone tell me what I am doing wrong here?
I am using MODX Revolution 2.2.10-pl (traditional). The last time I did any serious snippet coding was in Evo, so I am having to re-learn an awful lot of stuff!
edit: same result whether I call the snippet with [[!products]] or with [[products]].
[ed. note: Gav last edited this post 12 years, 9 months ago.]