|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
destinationOne Smarty n00b
Joined: 21 Dec 2012 Posts: 1
|
Posted: Fri Dec 21, 2012 6:23 am Post subject: {php}{/php} error in template |
|
|
Hi everybody,
I am using the SmartyEngine for the first time - at the moment, everything works fine, except one thing.
I have template file "header.tpl" an in this file I want to add a little bit of PHP-Code. I have done this like so:
Code: | {php}echo "Hello World";{/php} |
When I open the page, this error appears:
http://pastehtml.com/view/cmbelf3vs.txt
I tried to delete the content of the php tags like so:
But the error shows up again.
Whats wrong here? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Dec 21, 2012 2:15 pm Post subject: |
|
|
If you are using Smarty 3, the {php} tag was removed. You can use backward-compatible mode if you really want it. But, there is *always* a better way than embedding PHP code in templates.
http://www.smarty.net/best_practices |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|