
Hello,
I’m converting a handcrafted html/php site into a Modx hosted one, so far all is well, I’m fairly pleased with Modx, however I have
come across this problem.
I am including an external php file from a snippet, in this file I have the following construct(abbreviated for clarity):-
function Generate()
{
Line 1
Line 2
return $output
}
//Main entry point
if ( isset(somevariable))
{
$chunkoutput="Default"
$chunkoutput = Generate();
$modx->setPlaceHolder(’mygeneration’,$chunkoutput)
}
Ok, this always returns null for $chunkoutput, if I comment out the call to Generate() it correctly returns the string "Default" as I’ve set.
If I comment out the call to Generate() and include the function body inline ie place Line 1, Line 2 above the placeholder call it also produces the correct output.
Why is the output variable set to null if I use a function call here?
No errors in the error-log of any kind, am I missing something obvious here? Can I turn on some debug inside modx to show me the actual code its generating?
Any pointers please. This is a bit of a show stopper at the moment.