Re: RE: AW: [SMARTY] Paging

From: Date: Thu, 12 Dec 2002 12:28:57 +0000
Subject: Re: RE: AW: [SMARTY] Paging
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6752@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. 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. Of course you're free to do as you wish, this is just advice :) --- At 2002-12-12, 12:10:00, Ben Phillips <ben@inchima.com> wrote: >> Sure, I use a loop to get the data out of the database, and a smarty >> {section} tag to display it but im talking about the logic behing >> generating the paging text & links, and whether there is a more >> efficient way to do it using Smarty than i'm currently using. > >check out http://sourceforge.net/projects/smartypages. > >i'm not sure if it'll do exactly what you want, but it might be a start. >it's a plugin which can be used to extract only the rows for the current >page, and also produce the navigation links for you. there's not much >documentation (in fact, there's none apart from comments in the files) >so if you need any help with it then let me know. > >i want more people to work on this. currently it only works with MySQL >and has several other limitations. it worked for my purposes, but if >anyone wants to make it better then please feel free. 'tis open source >after all. > >cheers, >benji. > > > >-- >Smarty General Mailing List (http://smarty.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

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