|
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 |
spark_legion Smarty n00b
Joined: 22 Mar 2014 Posts: 1
|
Posted: Sat Mar 22, 2014 8:28 pm Post subject: unrecognized tag: settype($_from, 'array') |
|
|
Hi i get an error when i use FOREACH
Fatal Error (256): Smarty error: [in evaluated template line 296]: syntax error: unrecognized tag: settype($_from, 'array'); (Smarty_Compiler.class.php, line 446)
Code: |
{foreach name=art item=article from=$articles}
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
{if !empty($article.img)}
<td style="width: 160px;" align="left" valign="top"><table width="150" border="0" cellpadding="0" cellspacing="0" style="border:solid 1px #000000;"><tr><td>[image src={$article.img} w=150 border=1 ]</td></tr></table></td>
{/if}
{if !empty($article.img)}
<td width="464" valign="top">
{/if}
{if empty($article.img)}
<td width="624" colspan="2" valign="top">
{/if}
<h1 style="font-size: 24px; font-family: Georgia, 'Times New Roman', Times, serif; color: #333333; margin-top: 0px; margin-bottom: 12px;">{$article.title}</h1>
<p style="font-size: 16px; line-height: 22px; font-family: Georgia, 'Times New Roman', Times, serif; color: #333; margin: 0px;">{$article.Content}</p>
</td>
</tr>
</tbody>
</table>
<!--line break-->
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td height="50" valign="bottom" style="text-align:center;"><img src="http://www.cegq.net/infolettre/uploads/template/0af6c918409f8dd4b35fee50ae0eef142.jpg" alt="" width="622" height="27" /></td>
</tr>
</tbody>
</table>
<!--/line break--> {/foreach}
|
When i remove the {foreach}{/foreach} it's work ... but i need to display a lot article |
|
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
|