Simple (I suppose..) Problem with section...
| From: | Fabio | Date: | Fri, 31 May 2002 09:42:05 +0000 |
| Subject: | Simple (I suppose..) Problem with section... | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-4476@lists.php.net to get a copy of this message | ||
I've created this template:
<HTML>
<TITLE>Hello</TITLE>
<BODY>
<TABLE>
{section name=people loop=$membri}
<TR><TD>{$membri[people].nome}</TD><TD>{$membri[people].email}</TD></TR>
{sectionelse}
Nessun membro è stato definito
{/section}
</TABLE>
<p>
Ci sono {$smarty.section.people.loop} membri nel database.
</BODY>
</HTML>
My problem is that when the "people" section is empty.. the message "Nessun
membro è stato definito" is diplayed between the <TABLE></TABLE>... Instead
I would like that the <TABLE></TABLE> will be used only if there are members
to display in the table rows...
And the "No members ..." message should not be in the <TABLE></TABLE>..
I hope to have explained what I'm trying to explain... :-P
Thank you.