hello,
when I try to load a snippet in a snippet I get this error.
Parse error: parse error, unexpected ’<’ in /home/.sites/106/site51/.users/100/sd/web/modx/manager/includes/document.parser.class.inc.php(748) : eval()’d code on line 2
I think it’s because the following is happening:
<?
$modx->runSnippet(’tester’);
?>
<---- tester---->
<?
echo"hello world";
?>
so what happends is this: <? <? echo"hello world"; ?> ?>
any ideas how to fix this
-
MODX Staff
- 10,725 Posts
You cannot use PHP tags inside a snippet.
well if I delete the php tags it ads them after I saved the snippet.
it won’t allow me not to use php tags...
-
☆ A M B ☆
- 24,524 Posts
The opening and closing php tags are automatically added for snippets (this is so that the context coloring plugins will know to use php syntax for code highlighting). Do not add them in your own snippet code.
Try making the first tag [tt]<?php[/tt] instead of just [tt]<?[/tt]. Also what revision are you using (Look at ’version codename’ under Reports -> System Info).