New version submitted by TomB
[carbonphp.git] / Documentation / libraries / pagination.html
blobc2a7592cafa8209df50efdd409b5155c806f515d
1 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
2 <head>
3 <title>CarbonPHP Documentation</title>
4 <style type="text/css">
5 * {
6 margin: 0;
7 padding: 0;
10 html {
11 font-family: "Lucida Sans Unicode", "Lucida Grande";
12 font-size: 12px;
15 body {
16 background: #fff;
17 color: #666;
20 h1 {
21 font-size: 15px;
22 font-weight: bold;
23 margin: 0 0 5px 0;
26 h2 {
27 font-size: 13px;
28 font-weight: bold;
29 margin: 5px 0 5px 0;
32 ol, ul {
33 margin: 10px 0 10px 0;
34 list-style-position: inside;
37 p {
38 margin: 5px 0 5px 0;
41 .content {
42 border: 1px dotted #444;
43 margin: 10px;
44 padding: 10px;
45 text-align: justify;
46 width: 700px;
49 .example {
50 border: 1px solid #ccc;
51 background: #eee;
52 margin: 10px;
53 padding: 10px;
55 </style>
56 </head>
58 <body>
59 <div class="content">
60 <h1>Pagination Library</h1>
62 <p>CarbonPHP's pagination library is very simple to use, and you can customise every aspect of it.</p>
63 </div>
65 <div class="content">
66 <h1>Pagination Example</h1>
68 <div class="example">
69 $this->load->library('pagination');<br />
70 <br />
71 $config['base_url'] = 'http://www.your-domain.com/index.php/some/page';<br />
72 $config['total_rows'] = '400';<br />
73 $config['per_page'] = '20';<br />
74 <br />
75 $this->pagination->initialise($config);<br />
76 <br />
77 echo $this->pagination->create_links();
78 </div>
80 <p>The <b>$config</b> array contains any configuration options. It is passed to the
81 <b>$this->pagination->initialise()</b> method.</p>
83 <p>If you do not wish to set the configuration options every time, you can create a configuration file
84 <b>application/config/pagination.php</b> with the configuration options in.</p>
85 </div>
87 <div class="content">
88 <h1>Configuration Options</h1>
90 <p><b>$config['uri_segment']</b> - This determines which segment of the URI contains the page number.</p>
92 <p><b>$config['num_links']</b> - This determines the number of digit links are either side of the current
93 page number.</p>
95 <p><b>$config['full_tag_open']</b> - This is the opening tag placed of the left of the entire result.</p>
97 <p><b>$config['full_tag_close']</b> - This is the closing tag placed at the end of the result.</p>
99 <p><b>$config['first_link']</b> - This is the text shown for the first link on the left.</p>
101 <p><b>$config['first_tag_open']</b> - This is the tag on the left of the first link.</p>
103 <p><b>$config['first_tag_close']</b> - This is the tag on the end of the first link.</p>
105 <p><b>$config['last_link']</b> - This is the text shown for the last link on the right.</p>
107 <p><b>$config['last_tag_open']</b> - This is the tag on the left of the last link.</p>
109 <p><b>$config['last_tag_close']</b> - This is the tag on the end of the last link.</p>
111 <p><b>$config['next_link']</b> - This is the text of the next page link.</p>
113 <p><b>$config['next_tag_open']</b> - This is the tag on the left of the next page link.</p>
115 <p><b>$config['next_tag_close']</b> - This is the tag on the end of the next page link.</p>
117 <p><b>$config['prev_link']</b> - This is the text of the previous page link.</p>
119 <p><b>$config['prev_tag_open']</b> - This is the tag on the left of the previous page link.</p>
121 <p><b>$config['prev_tag_close']</b> - This is the tag on the end of the previous page link.</p>
123 <p><b>$config['cur_tag_open']</b> - This is the opening tag for the current page link.</p>
125 <p><b>$config['cur_tag_close']</b> - This is the closing tag for the current page link.</p>
127 <p><b>$config['num_tag_open']</b> - This is the opening tag for the digit link.</p>
129 <p><b>$config['num_tag_close']</b> - This is the closing tag for the digit link.</p>
130 </div>
132 </body>
134 </html>