Re: New looping method proposal

From: Date: Mon, 19 Nov 2001 16:19:07 +0000
Subject: Re: New looping method proposal
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1965@lists.php.net to get a copy of this message
Andreas Kossmeier wrote: > hi, > > Anders Janson wrote: > > If the {foreach} could be hacked as a plugin or custom function, I'd > > say "Yes!! Go for it!!". > > it wouldn't be a plugin nor a custom function, it's just an addition to > the (smarty) language, the functionality is basically the same, it's > just an easier way of using it. > > you shouldn't compare this with e.g. a specialized table function, it's > basically not the same (language contructs vs. custom functions). I know that. I said "If....". Custom tags like {mytag}...{/mytag} would be language extensions, not just a custom function, but it can not be done. Yet. But IF or WHEN they do, I think this {foreach} tag would make an excellent one. Just keep it out of the core. Why? Less code. Less documentation. Less confusion. > > > > Which means the only way is to hack the Smarty core, and I really > > don't like the thought. > > - If it works, don't fix it. > > - If it is too specialized: don't add it. > > - If it is optional - Sure, why not!? > > if we can enhance the (smarty) template language, why shouldn't we > think about it? and since it is only an addition, i think, it's worth > considering. The Perl programmers say "There is more that one way to do it." Yeah great, have you ever looked at Perl source, written by someone who knew ONE way, but not a good one!? :-o Or even worse, by someone who actually *knew* a good one?? ;) I am not the one to decide, but I would rather see things taken OUT of Smarty. I want fast, small code, and a small vocabulary. Not kitchen sinks. I know I have asked for features in the past. Guilty. But if things could be more modular and optional, I'd like Smarty even more :) /Anders

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