Imbo\Http\Request\Request::getRawUri PHP Méthode

getRawUri() public méthode

Get the URI without the Symfony normalization applied to the query string, un-encoded
public getRawUri ( ) : string
Résultat string
    public function getRawUri()
    {
        $query = $this->server->get('QUERY_STRING');
        if (!empty($query)) {
            $query = '?' . urldecode($query);
        }
        return $this->getSchemeAndHttpHost() . $this->getBaseUrl() . $this->getPathInfo() . $query;
    }

Usage Example

Exemple #1
0
 /**
  * @dataProvider getQueryStrings
  */
 public function testGetRawUriDecodesUri($queryString, $expectedQueryString)
 {
     $request = new Request([], [], [], [], [], ['SERVER_NAME' => 'imbo', 'SERVER_PORT' => 80, 'QUERY_STRING' => $queryString]);
     $uri = $request->getRawUri();
     $this->assertSame($expectedQueryString, substr($uri, strpos($uri, '?') + 1));
 }
All Usage Examples Of Imbo\Http\Request\Request::getRawUri