Hi,
I’m writting a snippet and observed that the "$modx" object cannot be accessed from within a function inside my snippet. I’m surprised that it is not global.
$temp = $modx->getDocumentObject('id',183);
is ok in the snippet core.
When put inside a function in the snippet I get :
Fatal error: Call to a member function getDocumentObject() on a non-object
Any idea how to handle this ?
Should I do something like :
and in function
$modx2 = getDocumentObject(...
or pass the $modx object as parameter of the function ?
I assume that the $modx object is quite large. Isn’t it ?
Thanks for your help.