Hello MODX’ers,
In Evolution I created my templates in PHP and included them with a simple ’include’ snippet.
This way I could edit the template in my favority HTML/PHP-editor.
In Revolution I am trying to do the same.
My template look like
[[getFile? &file=`/assets/websites/mywebsite/templates/default_template.php` ]]
And my ’getFile’ snippet looks like
<?php
if (isset($file) && $file != "") {
$f = getcwd() . $file;
if (file_exists($f)) {
$o = file_get_contents($f);
} else {
$o = "<p>File not found: " . $f . "</p>";
}
} else {
$o = "getFile parameter 'file' missing";
}
return $o;
But now the PHP code is not intepreted. I see PHP code in the Source on the browser side.
Is this a MODX-Revolution thing or a PHP thing?
And the other question is how you would include a Template.
Thanks,
Bert