示例#1
0
function requestUri()
{
    $requestUri = server('currentPath') ? substr(server('currentPath'), 1) : currentUri();
    if (@$requestUri[strlen($requestUri) - 1] === '/') {
        $requestUri = substr($requestUri, 0, -1);
    }
    $requestUri = routeUri($requestUri);
    return str_replace(suffix(getLang()), '', cleanInjection($requestUri));
}
示例#2
0
 public function currentSegment()
 {
     $str = substr(server('currentPath'), 1, strlen(server('currentPath')) - 1);
     $str = explode("/", $str);
     if (count($str) > 1) {
         return cleanInjection($str[count($str) - 1]);
     }
     return cleanInjection($str[0]);
 }