RE: [SMARTY] template error
| From: | Eduardo | Date: | Mon, 03 Nov 2003 15:17:03 +0000 |
| Subject: | RE: [SMARTY] template error | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10493@lists.php.net to get a copy of this message | ||
Your template is wrong.
Around line 92 of your template you have this inside a {section}:
{if $discountShown == 1}
<td align="right">EUR {$dataItem.d_ab1}</td>
{if $discountShown == 6}
<td align="right">EUR {$dataItem.d_ab6}</td>
{if $dicountShown == 12}
<td align="right">EUR {$dataItem.d_ab12}</td>
{else}
<td align="right">EUR {$data.Item.d_ab4}</td>
{/if}
if what you try to do is emulate a "switch" control structure then you
need to use {elseif}:
{if $discountShown == 1}
<td align="right">EUR {$dataItem.d_ab1}</td>
{elseif $discountShown == 6}
<td align="right">EUR {$dataItem.d_ab6}</td>
{elseif $dicountShown == 12}
<td align="right">EUR {$dataItem.d_ab12}</td>
{else}
<td align="right">EUR {$data.Item.d_ab4}</td>
{/if}
if not you need to pair every {if} with its respective {/if}
Of course the template doesn't have 210 lines, but the PHP code that
Smarty generates from the template does. Remember that smarty
"compiles" the templates into PHP files. What is happening here is that
because you have errors in the template the final PHP file is wrong too.
Hope it helps
Eduardo.
-----Original Message-----
From: Webmaster [mailto:webmaster@dentona.de]
Sent: Monday, November 03, 2003 8:14 AM
To: smarty-general@lists.php.net
Subject: [SMARTY] template error
Hi,
i am giving up on a problem and hope somebody can help me.
Iam getting the following error message:
Parse error: parse error, unexpected T_ENDFOR in
d:\new\smarty\templates_c\%%-88\%%-887988192\catalog.tpl.php on line 210
The problem is that the template doesn't even have 210 lines. I checked
line
by line many times.
Please can anybody tell we what is wrong?