diff options
author | admin <devnull@localhost> | 2006-09-21 19:22:21 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-09-21 19:22:21 +0200 |
commit | 05633d7348b85147a46a7396c3bee1928335fa7a (patch) | |
tree | 768d109a5094a58c135b3a59bae79c9e7d8bc8d9 /system | |
parent | a4d35347327c1e9a464696d153ad6f2ec4510283 (diff) |
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Parser.php | 2 | ||||
-rw-r--r-- | system/libraries/URI.php | 41 |
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()).'/'; } |