$request = new AphrontRequest($_GET, $_POST, $_COOKIE, $_FILES, $_SERVER); $uri = $request->getRequestURI(); echo $uri; //output: http://example.com/my-page
$uri = AphrontRequest::getURI(); echo $uri; //output: http://example.com/another-pageIn this example, we use the static method getURI of AphrontRequest class to get the current URL and store it in $uri variable. Finally, we echo the URL. Package library: Phabricator Platform.