summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-01-20 12:30:05 +0100
committerAndrey Andreev <narf@devilix.net>2015-01-20 12:30:05 +0100
commit0da50123c196ca0f342cac44b76f889a6f8a96b9 (patch)
treea5113605fd6de93020b9b39c05a9e10a08279919
parent90726b8c769ea75aec34814ddfa91655d488e6c3 (diff)
Pagination: Add 'use_global_url_suffix' setting
Resolves issue #1887
-rw-r--r--system/libraries/Pagination.php12
-rw-r--r--user_guide_src/source/changelog.rst3
-rw-r--r--user_guide_src/source/libraries/pagination.rst6
3 files changed, 20 insertions, 1 deletions
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
@@ -299,6 +299,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
*
* @var string
@@ -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 ``&nbsp;`` from a number of the configuration variables.
- - Added support for ``$config['num_links'] = 0`` configuration.
- :doc:`Profiler Library <general/profiling>` 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
***********************