RE: [PHP] smarty
| From: | Chris W. Parker | Date: | Tue, 06 Apr 2004 18:55:17 +0000 |
| Subject: | RE: [PHP] smarty | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-182521@lists.php.net to get a copy of this message | ||
Chris de Vidal <mailto:chris@devidal.tv>
on Tuesday, April 06, 2004 11:43 AM 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}
i've never used smarty* but i think i understand how it works. so my
question is this...
would it not be better to place that logic in your php code instead of
your template?
my thinking is this: if {bio} contains anything, it will print to the
page. if it doesn't contain anything, nothing will be printed. so
there's no need to check the value of $level within the template since
{bio} will simply contain something, or it will not.
i'm purely looking to understand this "smarty" thing a little better. :)
chris.
* i did try it once or twice in the past, with little things but didn't
quite grasp it.