Re: [SMARTY-DEV] Suggestion: make template commands case insensitive
| From: | Andrei Zmievski | Date: | Mon, 28 Apr 2003 17:40:06 +0000 |
| Subject: | Re: [SMARTY-DEV] Suggestion: make template commands case insensitive | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1278@lists.php.net to get a copy of this message | ||
On Wed, 23 Apr 2003, Wom.bat wrote:
> Hi folks ;)
>
> I told messju about this one a week ago, he hasn't answered yet,
> so I thought it would be better anyways to put this issue in here:
>
> Wouldn't it be logical to be able to do either {dowhatever} or {doWhatever}
> or {DoWhatever} or whatever ;))
> PHP is case-insensitive with functions as well, so why not make Smarty the
> same? VARIABLES, of course, should remain case-sensitive, but one should be
> able to use his preferred notation for function/block/filter calls. I know
> there are underscores used within Smarty, but I personally prefer camel
> notation (whoWantsToLiveForever), and have a small class which extends
> smarty and automatically registers functions, blocks, filters etc embedded
> within this class. PHP's get_class_methods() returns lower-case method
> names, and as such they are registered in smarty - so I cannot do
> {displayMenu id="2"} in my templates, but instead I have to write
> {displaymenu...}...
>
> In my eyes, this simply makes no sense, and changing the responsible preg to
> "/i" wouldn't cause any compatibility issues, would it? ;)
No way. PHP being case-insensitive is simply bad. Let's not do the same
for Smarty.
-Andrei http://www.gravitonic.com/
Some people sell razors. Other people sell razor blades. Microsoft
sells shaving cream containing 5% hair growth hormone.
-- sigwinch, posting to Kuro5hin