| 104 | | * Fetches the current URI. |
|---|
| 105 | | * |
|---|
| 106 | | * @param boolean include the query string |
|---|
| 107 | | * @return string |
|---|
| 108 | | */ |
|---|
| 109 | | public static function current($qs = FALSE) |
|---|
| 110 | | { |
|---|
| 111 | | return Router::$current_uri.($qs === TRUE ? Router::$query_string : ''); |
|---|
| | 115 | * Merges an array of arguments with the current URI and query string to |
|---|
| | 116 | * overload, instead of replace, the current query string. |
|---|
| | 117 | * |
|---|
| | 118 | * @param array associative array of arguments |
|---|
| | 119 | * @return string |
|---|
| | 120 | */ |
|---|
| | 121 | public static function merge(array $arguments) |
|---|
| | 122 | { |
|---|
| | 123 | if ($_GET === $arguments) |
|---|
| | 124 | { |
|---|
| | 125 | $query = Router::$query_string; |
|---|
| | 126 | } |
|---|
| | 127 | elseif ($query = http_build_query(array_merge($_GET, $arguments))) |
|---|
| | 128 | { |
|---|
| | 129 | $query = '?'.$query; |
|---|
| | 130 | } |
|---|
| | 131 | |
|---|
| | 132 | // Return the current URI with the arguments merged into the query string |
|---|
| | 133 | return Router::$current_uri.$query; |
|---|