Re: Conditional include
| From: | Andreas Aderhold | Date: | Thu, 19 Jul 2001 14:42:09 +0000 |
| Subject: | Re: Conditional include | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1209@lists.php.net to get a copy of this message | ||
Hi Andrei,
>> but that's a bit un-handy. Maybe there is a a general need to implement a
>> shorter syntax to conditionally include a file, e.g.:
>>
>> {include file="formwarnings.html" if=$T_WARNINGS}
>>
> Nope. Smarty is not designed with just programmers in mind, but also
> with designers. I'd like to adhere to KISS principle as much as
> possible.
Agreed to KISS and the design goals of smarty. But a conditional include
would not break these goald. "section" has the show attribute too and it
would be also a benefit for designers. Its just a _simplification_ of
{if $ERROR_ARRAY}
{include file="errorbox.html"}
{/if}
I think {include file="errorbox.html" show=$ERROR_ARRAY} makes the code more
readable and more comprehensive for the designers who never heard of if
clauses.
Andi