summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Parser.php2
-rw-r--r--system/libraries/URI.php41
2 files changed, 39 insertions, 4 deletions
diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php
index 9f6a814ae..b07b64fdd 100644
--- a/system/libraries/Parser.php
+++ b/system/libraries/Parser.php
@@ -47,7 +47,7 @@ class CI_Parser {
$OUT =& _load_class('CI_Output');
$obj =& get_instance();
- $template = $obj->load->view($template, '', TRUE);
+ $template = $obj->load->view($template, $data, TRUE);
if ($template == '')
{
diff --git a/system/libraries/URI.php b/system/libraries/URI.php
index 11562eb29..e831d9526 100644
--- a/system/libraries/URI.php
+++ b/system/libraries/URI.php
@@ -107,6 +107,41 @@ class CI_URI {
*/
function uri_to_assoc($n = 3, $default = array())
{
+ return $this->_uri_to_assoc($n, $default, 'segment');
+ }
+ /**
+ * Identical to above only it uses the re-routed segment array
+ *
+ */
+ function ruri_to_assoc($n = 3, $default = array())
+ {
+ return $this->_uri_to_assoc($n, $default, 'rsegment');
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Generate a key value pair from the URI string or Re-routed URI string
+ *
+ * @access private
+ * @param integer the starting segment number
+ * @param array an array of default values
+ * @param string which array we should use
+ * @return array
+ */
+ function _uri_to_assoc($n = 3, $default = array(), $which = 'segment')
+ {
+ if ($which == 'segment')
+ {
+ $total_segments = 'total_segments';
+ $segment_array = 'segment_array';
+ }
+ else
+ {
+ $total_segments = 'total_rsegments';
+ $segment_array = 'rsegment_array';
+ }
+
if ( ! is_numeric($n))
{
return $default;
@@ -117,7 +152,7 @@ class CI_URI {
return $this->keyval[$n];
}
- if ($this->total_segments() < $n)
+ if ($this->$total_segments() < $n)
{
if (count($default) == 0)
{
@@ -132,7 +167,7 @@ class CI_URI {
return $retval;
}
- $segments = array_slice($this->segment_array(), ($n - 1));
+ $segments = array_slice($this->$segment_array(), ($n - 1));
$i = 0;
$lastval = '';
@@ -322,7 +357,7 @@ class CI_URI {
* @access public
* @return string
*/
- function uri_rstring()
+ function ruri_string()
{
return '/'.implode('/', $this->rsegment_array()).'/';
}