Quote from: sottwell at Sep 30, 2010, 07:11 AM
The include function returns 1 for success and 0 for failure. If you return the return value of an include statement, you’ll get the 1 (or the 0 if it fails). You just want the include function to do its thing, not display a return value.
<?php
if (!file_exists($file)) return '';
include $file;
return;
?>
Susan, That’s only true if the "included" file has no return statement. if the included file has a return statement,
return include $modx->getOption('assets_path') . 'file.php';
will return that value rather than 0 or 1.
IOW, if file.php contains
the snippet tag will be replaced with "Hello there." (At least in Revo -- I assume it would be the same in Evo).
That means that for any "return included" file that contains
return ’’;
There won’t be any output where the tag is.