|
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 |
Christian Smarty n00b
Joined: 19 Jun 2003 Posts: 4 Location: Hessen, Deutschland
|
Posted: Thu Jun 19, 2003 10:18 pm Post subject: 2 newbie questions |
|
|
Hi and hello. I am new to Smarty and today I tried to wrote my templates for smarty.
[root@localhost htdocs]# php index.php
Content-type: text/html
X-Powered-By: PHP/4.3.1
<br />
<b>Fatal error</b>: Smarty: [in header.tpl line 51]: syntax error: unrecognized tag: {$skin_zusatz (Smarty_Compiler.class.php, line 382) in <b>/usr/webserver1/christiankorff.de/beta1/smarty/libs/Smarty_Compiler.class.php</b> on line <b>1824</b><br />
How to know that I am making wrong? I use a lot of code in the following form:
<a href="?{if $skin_zusatz != ""}{$skin_zusatz}{/if}">HOME</a>
The second question is very simple:
How to escape the { in Smarty Templates? |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Thu Jun 19, 2003 10:36 pm Post subject: |
|
|
First why not use {$skin_zusatz|default:""} so if the var doesnt exist it will show nothing and second put the text in {literal}...{/literal} to not have it parse the {} _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Jun 19, 2003 11:24 pm Post subject: |
|
|
Hello, Christian.
That does look weird. AZTEK certainly has the right idea (Hi Aztek)
What does this do for you?
Code: | <a href="?{if $skin_zusatz}{$skin_zusatz}{/if}">HOME</a> |
As for escaping the delimiters, see: this thread. Further, $smarty->left_delimiter and $smarty->right_delimiter define the delimiters (you can set them to anything convenient for your purposes.)
greets. |
|
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
|