RE: RE: AW: [SMARTY] Paging

From: Date: Thu, 12 Dec 2002 12:43:49 +0000
Subject: RE: RE: AW: [SMARTY] Paging
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6753@lists.php.net to get a copy of this message
> I made a similar plugin a while back ... it's highly > impractical, because you're putting SQL statements in Smarty > templates - the layout templates get "polluted" with > functionality, which means you expose this functionality to > the designer. Also, by performing the SQL query inside the > template, you make it impractical to perform any additional > post-query PHP-processing on the query-result. the query isn't exposed in the template. it can be, or it can be set in the php code so that the template designer simply calls the plugin with the query variable. the query is often never seen by the designer. > Functionality like paging doesn't really belong in a Smarty > plugin, for a template designer to use - because most > template designers don't know how to; it belongs in a PHP > library, where the programmer can use it. i have to disagree with this. the designer may or may not wish to use paging, depending on the type of page they are designing. they will also wish to position the results from the query as well as the navigation string wherever they like. they may also want to alter the text for the navigation string, and how it is displayed - options that should be made available for them when they are designing the template. these options are set by the designer, not the php programmer and therefore the designer should have access to the functionality. what if they want to display 10 results per page? or 20? that's not up to the php programmer - that's in the realm of the designer. if there is a more elegant way of doing this, then please let me know. benji.

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