Discussion: capitalize modifier
Afficher un message
Vieux 27/11/2005, 03h37   #10
A.J. Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: [SMARTY] capitalize modifier

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



  Réponse avec citation
 
Page generated in 0,04841 seconds with 9 queries