{section} docs, was: Re: [SMARTY] Newbie Question: Associative Arrays and Sections
| From: | Mark Rogers | Date: | Mon, 04 Jul 2005 14:03:39 +0000 |
| Subject: | {section} docs, was: Re: [SMARTY] Newbie Question: Associative Arrays and Sections | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12766@lists.php.net to get a copy of this message | ||
Patrick Ben Koetter writes:
> WOW! That was quick! Thank you guys!
Patrick,
Based on what you said you obviously looked in the manual and the archives
for help before you tried this list for help on this one.
Since this must be one of the most commonly asked questions, the current
documentation is obviously not doing a very good job on this subject. So,
can you suggest (from your own point of view) how this could be made
clearer?
Personally I'd stick a big red note against {section} saying something to
the effect of:
In most cases, and in ALL cases involving associative
(non-numeric indexed) arrays or numerical indexes
which don't increment from zero, you should use
{foreach} rather than {section}.
Of-course a lot of people won't read it anyway, but at least those who do
will avoid this pitfall?
I worry that for every person who gets stuck here and mails the list there
must be someone who tried Smarty and gave up because they couldn't make it
work.
Mark Rogers,
More Solutions Ltd