Re: [SMARTY-DEV] function.html_options.php

From: Date: Thu, 04 Apr 2002 17:04:08 +0000
Subject: Re: [SMARTY-DEV] function.html_options.php
References: 1 2 3 4  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-22@lists.php.net to get a copy of this message
> True, this can be handy in certain situations. I'm just thinking of > things from another perspective. Let's say the array of data comes from > a database. All of a sudden my "order by" clause has no control over > what order things are being displayed, this control has just been handed > over to the template engine. Is that permissable, or should the > application be handling these semantics? If the programmer set a array with a specific order, the designer dont need to order the array. The default of the modificated custom function is NO change the order of the array. > Maybe there is no problem at all, and reordering assigned arrays in the > template engine is quite alright. I'm just looking for some more > thoughts on it. Reorder is an option of the Designer. > To go to the extreme, why not make every function of PHP a custom > function in the template engine? {array_sort array=$foo} For Security. IMHO, usefulls PHP functions can be an Smarty custom function. I guess the purpose of Smarty is split Code to Html. In the Code the hard things are made. In the HTML we have pure HTML to Code assigns. Many time a Designer need transform the Code assigns. If you think sort the options isn't a HTML work, so you need agree with me that the all modifiers isn't work to the HTML part, because they change what the Code assigned. Why a Designer will use modifier_regex_replace? Again, IMHO, all usefulls functions that modifier an Array or a String should be part of the Template. Maybe not part of Smarty official release, but maybe a User Plugin.

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