0

I am trying to write a PHP oneliner to show a link to another page. This is in Expression Engine. I came with this:

echo  '<li><p><a href="{path='Site2/matcha-tea'}">Matcha Tea</a></p></li>';

But it gives this error:

Parse error: syntax error, unexpected '{', expecting ',' or ';' in /home/...../system/expressionengine/libraries/Functions.php(680) : eval()'d code on line 42

4

2 回答 2

0

Your mixing your quotes ... you could do it this way :

echo '<li><p><a href="{path=\'Site2/matcha-tea\'}">Matcha Tea</a></p></li>';
于 2012-06-11T14:57:09.827 回答
0

You have an issuewhere you did not escape the quotes within your quotes.

Try this:

echo  '<li><p><a href="{path=\'Site2/matcha-tea\'}">Matcha Tea</a></p></li>';

Or you can just escape out of php in general since you are not using any PHP variable in that list item:

?>
    <li><p><a href="{path='Site2/matcha-tea'}">Matcha Tea</a></p></li>
<?php
于 2012-06-11T14:58:01.447 回答