segment() public method

Fetch URI Segment
See also: CI_URI::$segments
public segment ( integer $n, mixed $no_result = NULL ) : mixed
$n integer Index
$no_result mixed What to return if the segment index is not found
return mixed
示例#1
0
文件: MY_URI.php 项目: ngangchill/po
 public function segment($n, $no_result = NULL)
 {
     if (!is_numeric($n)) {
         if (array_key_exists($n, $this->uri_parameters)) {
             $n = $this->uri_parameters[$n];
         } else {
             return $no_result;
         }
     }
     return parent::segment($n, $no_result);
 }