This may be a noob question, but I've searched this forum and nothing fit.
My include file (snippet.inc.php):
<?php
include_once $modx->config['base_path'].'template.php';
$a='a variable';
template(); // I'm trying to display the result
?>
My template function (template.php):
<?php
function template(){ // This was meant to be a display function
global $a;
echo 'I\'m calling '.$a;
}
?>
If I run this code outside of modx, it works.
I'm calling a variable // test outside modx
I'm calling // result in modx
How to make it run inside modx?