RE: [PHP] smarty

From: Date: Tue, 06 Apr 2004 20:43:18 +0000
Subject: RE: [PHP] smarty
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-182546@lists.php.net to get a copy of this message
Chris W. Parker 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} I should have put < html for bio or image or hyperlink > The way I put it there it looks like Smarty template code. >> {/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 could, but bio/image/hyperlink has HTML that I want to leave for my Front Page developer to be able to tweak. I want her to make it pretty and I just want to make it work. When the PHP code also had HTML her Front Page was constantly screwing with the code. And now she can mock up a new website in whatever she wants (Word exported to HTML for all I care) and I can hook in PHP code very easily. Together we can knock out nice-looking sites in far less time. /dev/idal

« previous php.general (#182546) next »