cvs: peardoc /en/package/html pager-sliding.xml /en/package/html/pager-sliding compare.xml

From: Date: Mon, 28 Apr 2003 06:26:56 +0000
Subject: cvs: peardoc /en/package/html pager-sliding.xml /en/package/html/pager-sliding compare.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-681@lists.php.net to get a copy of this message
tuupola Mon Apr 28 02:26:56 2003 EDT Added files: /peardoc/en/package/html/pager-sliding compare.xml Modified files: /peardoc/en/package/html pager-sliding.xml Log: * adding Pager_Sliding documentation by Lorenzo Alberton Index: peardoc/en/package/html/pager-sliding.xml diff -u peardoc/en/package/html/pager-sliding.xml:1.2 peardoc/en/package/html/pager-sliding.xml:1.3 --- peardoc/en/package/html/pager-sliding.xml:1.2 Mon Mar 10 17:27:43 2003 +++ peardoc/en/package/html/pager-sliding.xml Mon Apr 28 02:26:56 2003 @@ -1,49 +1,50 @@ -<!-- $Revision: 1.2 $ --> -<sect1 id="package.html.pager-sliding"> - <title>Pager_Sliding</title> - - <para> - Data paging class which also builds links to the pages. - </para> - <para> - - </para> - - &package.html.pager-sliding.intro; - &package.html.pager-sliding.getcurrentpageid; - &package.html.pager-sliding.getlinks; - &package.html.pager-sliding.getnextpageid; - &package.html.pager-sliding.getoffsetbypageid; - &package.html.pager-sliding.getpagedata; - &package.html.pager-sliding.getpageidbyoffset; - &package.html.pager-sliding.getpreviouspageid; - - &package.html.pager-sliding.isfirstpage; - &package.html.pager-sliding.islastpage; - &package.html.pager-sliding.islastpagecomplete; - - &package.html.pager-sliding.numitems; - &package.html.pager-sliding.numpages; - - &package.html.pager-sliding.sliding; - - </sect1> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-omittag:t -sgml-shorttag:t -sgml-minimize-attributes:nil -sgml-always-quote-attributes:t -sgml-indent-step:1 -sgml-indent-data:t -sgml-parent-document:nil -sgml-default-dtd-file:"../../../manual.ced" -sgml-exposed-tags:nil -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -End: -vim600: syn=xml fen fdm=syntax fdl=2 si -vim: et tw=78 syn=sgml -vi: ts=1 sw=1 ---> +<!-- $Revision: 1.3 $ --> +<sect1 id="package.html.pager-sliding"> + <title>Pager_Sliding</title> + + <para> + Data paging class which also builds links to the pages. + </para> + <para> + + </para> + + &package.html.pager-sliding.intro; + &package.html.pager-sliding.compare; + &package.html.pager-sliding.getcurrentpageid; + &package.html.pager-sliding.getlinks; + &package.html.pager-sliding.getnextpageid; + &package.html.pager-sliding.getoffsetbypageid; + &package.html.pager-sliding.getpagedata; + &package.html.pager-sliding.getpageidbyoffset; + &package.html.pager-sliding.getpreviouspageid; + + &package.html.pager-sliding.isfirstpage; + &package.html.pager-sliding.islastpage; + &package.html.pager-sliding.islastpagecomplete; + + &package.html.pager-sliding.numitems; + &package.html.pager-sliding.numpages; + + &package.html.pager-sliding.sliding; + + </sect1> +<!-- Keep this comment at the end of the file +Local variables: +mode: sgml +sgml-omittag:t +sgml-shorttag:t +sgml-minimize-attributes:nil +sgml-always-quote-attributes:t +sgml-indent-step:1 +sgml-indent-data:t +sgml-parent-document:nil +sgml-default-dtd-file:"../../../manual.ced" +sgml-exposed-tags:nil +sgml-local-catalogs:nil +sgml-local-ecat-files:nil +End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 +--> Index: peardoc/en/package/html/pager-sliding/compare.xml +++ peardoc/en/package/html/pager-sliding/compare.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.pager-sliding.compare"> <refnamediv> <refname><classname>Pager</classname> vs. <classname>Pager_Sliding</classname></refname> <refpurpose>Feature comparison of the two classes</refpurpose> </refnamediv> <refsect1 id="package.html.pager-sliding.compare.intro"> <title>What are the differences with <classname>Pager</classname>?</title> <para> While <classname>Pager</classname> has a "jumping window" style, <classname>Pager_Sliding</classname> has a "sliding window" style. What does that mean? Let's see an example: </para> </refsect1> <refsect1 id="package.html.pager-sliding.compare.example_pager"> <title><classname>Pager</classname> logic</title> <para> Let's suppose that the data spans on 15 pages, and the window width is 5 page links. The links are built on "frames" of 5 pages each: [1-5] [6-10] [11-15] <classname>Pager</classname> always shows the same 5 page links while you are on one of these pages. Here's a temporal succession of the links, starting from page 1 and moving forward. There are brakets around current page number to highlight this: <programlisting role="php"> <![CDATA[ a) {1} 2 3 4 5 => // first frame: [1-5] b) <= 1 {2} 3 4 5 => c) <= 1 2 {3} 4 5 => d) <= 1 2 3 {4} 5 => e) <= 1 2 3 4 {5} => // HERE IT JUMPS TO THE NEXT FRAME f) <= {6} 7 8 9 10 => // second frame: [6-10] g) <= 6 {7} 8 9 10 => h) <= 6 7 {8} 9 10 => ]]> </programlisting> and so on. See what a "jumping window" frame is? When you reach a limit (in the example, you go from page 5 to page 6), it "jumps" to next frame (links from page 6 to 10). </para> </refsect1> <refsect1 id="package.html.pager-sliding.compare.example_pager_sliding"> <title><classname>Pager_Sliding</classname> logic</title> <para> Instead of jumping from one frame to the other, with <classname>Pager_Sliding</classname> the change is done smoothly, and the current page is always shown at the center of the "window" (except of course for the first and the last pages): <programlisting role="php"> <![CDATA[ a) {1} 2 3 4 5 => [15] b) [1] <= {2} 3 4 5 6 => [15] c) [1] <= 2 {3} 4 5 6 => [15] d) [1] <= 2 3 {4} 5 6 => [15] // HERE IT's STARTING WORKING AS DESIGNED e) [1] <= 3 4 {5} 6 7 => [15] // see: current page number is at the center of the window f) [1] <= 4 5 {6} 7 8 => [15] // and it stays there... g) [1] <= 5 6 {7} 8 9 => [15] h) [1] <= 6 7 {8} 9 10 => [15] ]]> </programlisting> and so on. </para> </refsect1> <refsect1 id="package.html.pager-sliding.compare.other"> <title>Other differences</title> <para> Apart from the different "philosophy", <classname>Pager_Sliding</classname> is also designed to be highly customizable. <itemizedlist> <listitem> <para> There are *many* options to change the look and feel of the links in your page. They are explained in the constructor docs. </para> </listitem> <listitem> <para> It can work with Apache mod_rewrite module too, see the examples for that. </para> </listitem> <listitem> <para> It is "template"-friendly, i.e. you can assign the processed links and page numbers to your custom vars and use them to draw your link bar according to your page layout, without worrying about the underlying logic. </para> </listitem> <listitem> <para> You can easily extend the class; this is useful if you plan to use the class in many different pages and you don't want to set the same options everytime: just set your preferred default values in your extending class and you're done! </para> </listitem> </itemizedlist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->

« previous php.pear.doc (#681) next »