RE: [SMARTY] capitalize modifier

From: Date: Sun, 27 Nov 2005 02:37:08 +0000
Subject: RE: [SMARTY] capitalize modifier
References: 1  Groups: php.smarty.general php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13179@lists.php.net to get a copy of this message
Capitalization isn't necessarily a function of logic. It can be, but most of the time it isn't. For example, if you want to display all names in caps...the logic has no business formatting them as so, and shouldn't care either. If you wanted to later drop the requirement of displaying all names in caps, you should change the client template, not the logic. Another example with the same case: if you use the same logic for two different client systems, one might require all capitals for the display, and the other might not. On the other hand, if your LOGIC requires all capitals (ex: SKU's) then forcing capitals is a function of model/logic, and not display. Whenever possible, you have to think "is this required for my logic, or preferred for my display?". A.J. Brown -----Original Message----- From: Daniel Hedrick [mailto:daniel@hedrick.org] Sent: Saturday, November 26, 2005 3:22 PM To: Smarty-General Subject: Re: [SMARTY] capitalize modifier On Nov 24, 2005, at 1:06 PM, Max Schwanekamp wrote: > perhaps *you* can fix it yourself and then fill us in on what you did. I made another mental note as to why I don't use most of the convenience functions of the Smarty templating system. Don't get me wrong... I like Smarty a lot. I think it does a great job of allowing me to separate logic from presentation. But much like trying to drive nails with a screwdriver, I generally don't use a template engine to capitalize my strings for me. ;-) -daniel -- http://www.hedrick.org/daniel?sig

« previous php.smarty.general (#13179) next »