Re: RE: RE: AW: [SMARTY] Paging
| From: | Rasmus Schultz | Date: | Thu, 12 Dec 2002 13:00:02 +0000 |
| Subject: | Re: RE: RE: AW: [SMARTY] Paging | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6754@lists.php.net to get a copy of this message | ||
I'm not starting an argument, I'm just telling you what I'd do :)
If I wanted to expose the number of items per page to the designer,
I would do so specifically, not generally with a plugin. Of course
it all depends on who you're working with etc. :)
--- At 2002-12-12, 12:43:00, Ben Phillips <ben@inchima.com> wrote:
>> 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.