@@ -5,28 +5,28 @@ |
||
| 5 | 5 | |
| 6 | 6 | private $requestUri = ''; |
| 7 | 7 | |
| 8 | - public function __construct(){ |
|
| 8 | + public function __construct() { |
|
| 9 | 9 | $this->requestUri = $_SERVER['REQUEST_URI']; |
| 10 | - $tmp = explode('/',$this->requestUri); |
|
| 11 | - foreach($tmp as $key=>$value){ |
|
| 10 | + $tmp = explode('/', $this->requestUri); |
|
| 11 | + foreach ($tmp as $key=>$value) { |
|
| 12 | 12 | $value = trim($value); |
| 13 | - if(empty($value)) unset($tmp[$key]); |
|
| 13 | + if (empty($value)) unset($tmp[$key]); |
|
| 14 | 14 | else $tmp[$key] = $value; |
| 15 | 15 | } |
| 16 | 16 | $tmp = array_values($tmp); |
| 17 | 17 | $this->requestUri = $tmp; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public function full(){ |
|
| 21 | - return '/'.implode('/',$this->requestUri); |
|
| 20 | + public function full() { |
|
| 21 | + return '/'.implode('/', $this->requestUri); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function part($number){ |
|
| 25 | - if(isset($this->requestUri[$number])) return (string) urldecode($this->requestUri[$number]); |
|
| 24 | + public function part($number) { |
|
| 25 | + if (isset($this->requestUri[$number])) return (string) urldecode($this->requestUri[$number]); |
|
| 26 | 26 | else return ''; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function host(){ |
|
| 29 | + public function host() { |
|
| 30 | 30 | return parse_url('http://'.$_SERVER['HTTP_HOST'])['host']; |
| 31 | 31 | } |
| 32 | 32 | |