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)); }
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]); }