Changeset 845
- Timestamp:
- 10/18/2007 01:47:55 PM (14 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/URI.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/URI.php
r844 r845 41 41 * 42 42 * @access public 43 * @param integer43 * @param mixed 44 44 * @param mixed 45 45 * @return mixed … … 47 47 public function segment($index = 1, $default = FALSE) 48 48 { 49 if (is_string($index)) 50 { 51 if (($key = array_search($index, self::$segments)) === FALSE) 52 return $default; 53 54 $index = $key + 2; 55 } 56 49 57 $index = (int) $index - 1; 50 58 … … 111 119 112 120 /** 113 * Returns the URI segment that is preceded by a certain other segment (label)114 *115 * @access public116 * @param string117 * @param mixed118 * @return mixed119 */120 public function label($label, $default = FALSE)121 {122 if (($key = array_search($label, self::$segments)) === FALSE)123 return $default;124 125 return $this->segment($key + 2, $default);126 }127 128 /**129 121 * Returns the total number of URI segments 130 122 *
