Maybe this just shows how inexperienced I am (or how little sleep I’ve gotten), but I’m running into some odd behavior as I move one of my Snippets from the database and into a file. There’s still a MODx Snippet, but most of it has been replaced with an include statement that references the new file in /assets/snippets/newfolder/mysnippet.php
Look at the two variations of the same line (used to debug a SQL query):
if ( isset($debug) ) { print $query_str; exit; };
if ( isset($debug) ) { return $query_str; exit; }; // This one only works if it's in the database, not in the file.
There’s nothing special in my include file... no functions are being called from the PHP code stored in the database. Is that why the "return" statement doesn’t work? I suspect that it would if I restructured my code so that the PHP code in the database called a function in the file. That would be a better way to do it... but I’m curious as to the explanation for the behavior here. Sorry if it’s really obvious, I just don’t follow what’s going on. Thanks!