|
|
@@ -5,11 +5,11 @@
|
|
|
|
|
|
<para>
|
|
|
In this first example we won't do anything spectacular, but hopefully it will
|
|
|
- give you a good idea of what Zend_Paginator is designed to do.
|
|
|
+ give you a good idea of what <classname>Zend_Paginator</classname> is designed to do.
|
|
|
Let's say we have an array called $data with the numbers 1 to 100 in it, which
|
|
|
- we want to divide over a number of pages. We can use the static <methodname>factory()</methodname>
|
|
|
- method in the <classname>Zend_Paginator</classname> class to get a <classname>Zend_Paginator</classname>
|
|
|
- object with our array in it.
|
|
|
+ we want to divide over a number of pages. We can use the static
|
|
|
+ <methodname>factory()</methodname> method in the <classname>Zend_Paginator</classname>
|
|
|
+ class to get a <classname>Zend_Paginator</classname> object with our array in it.
|
|
|
</para>
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|
|
|
@@ -49,7 +49,8 @@ foreach ($paginator as $item) {
|
|
|
|
|
|
<para>
|
|
|
Now let's try and render the items on the second page. You can use the
|
|
|
- <methodname>setCurrentPageNumber()</methodname> method to select which page you want to view.
|
|
|
+ <methodname>setCurrentPageNumber()</methodname> method to select which page you want to
|
|
|
+ view.
|
|
|
</para>
|
|
|
|
|
|
<programlisting language="php"><![CDATA[
|
|
|
@@ -79,10 +80,10 @@ foreach ($paginator as $item) {
|
|
|
|
|
|
<para>
|
|
|
These simple examples demonstrate a small portion of what can be achieved with
|
|
|
- <classname>Zend_Paginator</classname>. However, a real application rarely reads its data from a plain
|
|
|
- array, so the next section is dedicated to showing you how you can use Paginator
|
|
|
- to paginate the results of a database query. Before reading on, make sure you're familiar with
|
|
|
- the way <classname>Zend_Db_Select</classname> works!
|
|
|
+ <classname>Zend_Paginator</classname>. However, a real application rarely reads its data
|
|
|
+ from a plain array, so the next section is dedicated to showing you how you can use
|
|
|
+ Paginator to paginate the results of a database query. Before reading on, make sure you're
|
|
|
+ familiar with the way <classname>Zend_Db_Select</classname> works!
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
@@ -117,8 +118,8 @@ foreach ($paginator as $item) {
|
|
|
The only difference is that you pass a <classname>Zend_Db_Select</classname> object to the
|
|
|
Paginator's <methodname>factory()</methodname> method, rather than an array.
|
|
|
For more details on how the database adapter makes sure that your query
|
|
|
- is being executed efficiently, see the Zend_Paginator chapter in the reference manual
|
|
|
- on the DbSelect and DbTableSelect adapters.
|
|
|
+ is being executed efficiently, see the <classname>Zend_Paginator</classname> chapter in the
|
|
|
+ reference manual on the DbSelect and DbTableSelect adapters.
|
|
|
</para>
|
|
|
|
|
|
</sect1>
|