Re: smarty
| From: | Chris de Vidal | Date: | Tue, 06 Apr 2004 20:45:13 +0000 |
| Subject: | Re: smarty | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182547@lists.php.net to get a copy of this message | ||
John W. Holmes said:
>> I could have put a tag in the template like {bio} but that'd mean
>> maintaining HTML in the PHP code which I wanted to avoid (left the
>> "prettyness" to the Front Page developer). Instead, I put something
>> like
>> this in the template:
>> {if $level > 2}
>> {bio}
>> {/if}
>
> Rather than putting "logic" into your presentation layer, the whole "bio"
> content should be a separate template. You then make the decision to
> either
> load the template into $bio or not from within PHP. So {$bio} will either
> be
> an empty string or the content of the other template, depending upon your
> PHP logic. And you still maintain the separation of "presentation" and
> "code"...
Why that would make too much sense ;-P Yeah I think I see what you're
saying.
CD