Re: smarty
| From: | John W. Holmes | Date: | Tue, 06 Apr 2004 19:09:26 +0000 |
| Subject: | Re: smarty | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182524@lists.php.net to get a copy of this message | ||
From: "Chris de Vidal" <chris@devidal.tv>
> 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"...
---John Holmes...