Re: [SMARTY-DEV] Suggestion: make template commands case insensitive

From: Date: Wed, 23 Apr 2003 07:28:15 +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-1255@lists.php.net to get a copy of this message
On Wed, Apr 23, 2003 at 03:35:58AM +0200, 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: hmm, yes sorry. see my private mail. grmpf. > 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? yes. this idea came up some time before but hasn't been done yet. i would definately also vote for making function/plugins-names case- insensitive. > 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? ;) only the filenames for autoloaded-plugins make me headaches: no problem on windows, where filenames are not case-sensitive (*shudder*). but on other system we can have function.showwhatever.php and function.showWhatEver.php in the plugin-dir. which one should we take? currently function.showWhatEver.php would be taken, but thats case- sensitive behaviour. if we change it to take function.showwhatever.php this *is* a BC issue but i ask, is this a real one? greetings messju > Regards, > David

« previous php.smarty.dev (#1255) next »