From 05633d7348b85147a46a7396c3bee1928335fa7a Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 21 Sep 2006 17:22:21 +0000 Subject: --- system/libraries/Parser.php | 2 +- system/libraries/URI.php | 41 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 4 deletions(-) (limited to 'system/libraries') 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()).'/'; } -- cgit v1.2.3-24-g4f1b