From 1f622294b92c095fd91e8ca44912d405c1605ded Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:06:51 -0400 Subject: Wow, I screwed that up, Reactor is going to 2.0.2 not 2.0.1 --- user_guide/libraries/pagination.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide/libraries/pagination.html') diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3db020adb..e86ec13cc 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

-- cgit v1.2.3-24-g4f1b From c0b133c02e057b6506726b794ba4582bf18ed663 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 22 Apr 2011 19:58:43 +0900 Subject: default value of $total_rows in Pagination class should be number. And fix User Guide Pagination Class's Example which uses string to number variable. --- user_guide/libraries/pagination.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide/libraries/pagination.html') diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index e86ec13cc..3c366a69f 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -71,8 +71,8 @@ Pagination Class $this->load->library('pagination');

$config['base_url'] = 'http://example.com/index.php/test/page/';
-$config['total_rows'] = '200';
-$config['per_page'] = '20'; +$config['total_rows'] = 200;
+$config['per_page'] = 20;

$this->pagination->initialize($config); -- cgit v1.2.3-24-g4f1b From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001 From: Razican Date: Mon, 25 Apr 2011 17:26:45 +0200 Subject: Fixed double-space typo. --- user_guide/libraries/pagination.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'user_guide/libraries/pagination.html') diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3c366a69f..a6b9287a3 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -72,26 +72,26 @@ Pagination Class $this->load->library('pagination');

$config['base_url'] = 'http://example.com/index.php/test/page/';
$config['total_rows'] = 200;
-$config['per_page'] = 20; +$config['per_page'] = 20;

$this->pagination->initialize($config);

-echo $this->pagination->create_links();
+echo $this->pagination->create_links();

Notes:

-

The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at -minimum you need the three shown. Here is a description of what those items represent:

+

The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at +minimum you need the three shown. Here is a description of what those items represent:

    -
  • base_url This is the full URL to the controller class/function containing your pagination. In the example - above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can +
  • base_url This is the full URL to the controller class/function containing your pagination. In the example + above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can re-route your URI if you need a different structure.
  • total_rows This number represents the total rows in the result set you are creating pagination for. Typically this number will be the total rows that your database query returned.
  • -
  • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
  • +
  • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.

The create_links() function returns an empty string when there is no pagination to show.

@@ -100,7 +100,7 @@ minimum you need the three shown. Here is a description of what those items rep

Setting preferences in a config file

If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called pagination.php, add the $config +Simply create a new file called pagination.php, add the $config array in that file. Then save the file in: config/pagination.php and it will be used automatically. You will NOT need to use the $this->pagination->initialize function if you save your preferences in a config file.

@@ -122,9 +122,9 @@ something different you can specify it.

$config['page_query_string'] = TRUE

By default, the pagination library assume you are using URI Segments, and constructs your links something like

http://example.com/index.php/test/page/20

-

If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

+

If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

http://example.com/index.php?c=test&m=page&per_page=20

-

Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

+

Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

Adding Enclosing Markup

If you would like to surround the entire pagination with some markup you can do it with these two prefs:

-- cgit v1.2.3-24-g4f1b