From 0da50123c196ca0f342cac44b76f889a6f8a96b9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Jan 2015 13:30:05 +0200 Subject: Pagination: Add 'use_global_url_suffix' setting Resolves issue #1887 --- system/libraries/Pagination.php | 12 ++++++++++++ user_guide_src/source/changelog.rst | 3 ++- user_guide_src/source/libraries/pagination.rst | 6 ++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index 6c8366435..aa54ec4c1 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -298,6 +298,13 @@ class CI_Pagination { */ protected $reuse_query_string = FALSE; + /** + * Use global URL suffix flag + * + * @var bool + */ + protected $use_global_url_suffix = FALSE; + /** * Data page attribute * @@ -373,6 +380,11 @@ class CI_Pagination { $this->page_query_string = TRUE; } + if ($this->use_global_url_suffix === TRUE) + { + $this->suffix = $this->CI->config->item('url_suffix'); + } + return $this; } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 2a61dd2bd..aace0281f 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -396,9 +396,10 @@ Release Date: Not Released - Added support for the anchor "rel" attribute. - Added support for setting custom attributes. - Added support for language translations of the *first_link*, *next_link*, *prev_link* and *last_link* values. + - Added support for ``$config['num_links'] = 0`` configuration. - Added ``$config['reuse_query_string']`` to allow automatic repopulation of query string arguments, combined with normal URI segments. + - Added ``$config['use_global_url_suffix']`` to allow overriding the library 'suffix' value with that of the global ``$config['url_suffix']`` setting. - Removed the default `` `` from a number of the configuration variables. - - Added support for ``$config['num_links'] = 0`` configuration. - :doc:`Profiler Library ` changes include: diff --git a/user_guide_src/source/libraries/pagination.rst b/user_guide_src/source/libraries/pagination.rst index 8c5c2c63a..d51d0dd27 100644 --- a/user_guide_src/source/libraries/pagination.rst +++ b/user_guide_src/source/libraries/pagination.rst @@ -131,6 +131,12 @@ the offset segment. A custom suffix added to the path. The sufix value will be right after the offset segment. +**$config['use_global_url_suffix'] = FALSE;** + +When set to TRUE, it will **override** the ``$config['suffix']`` value and +instead set it to the one that you have in ``$config['url_suffix']`` in +your **application/config/config.php** file. + *********************** Adding Enclosing Markup *********************** -- cgit v1.2.3-24-g4f1b