Reputation: 21
I am using at the moment the Smarty PHP Engine. Now I want to add a little bit of PHP-Code to the template file, like so:
{php}echo "asdf";{/php}
But when I open the browser this error appears:
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template
What seems the problem, and how can I fix that?
Upvotes: 2
Views: 148
Reputation: 5641
{php}
// including a php script directly from the template.
include('/path/to/display_weather.php');
{/php}
This way you can embed php codes into smarty template files. check this for reference http://www.smarty.net/docsv2/en/language.function.php.tpl
Upvotes: 0