Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions system/HTTP/IncomingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class IncomingRequest extends Request
* AFTER the script name. So, if hosted in a sub-folder this will
* appear different than actual URL. If you need that use getPath().
*
* @TODO should be protected. Use getUri() instead.
*
* @var URI
*/
public $uri;
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/concepts/http.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ is an object-oriented representation of the HTTP request. It provides everything
$request = service('request');

// the URI being requested (i.e., /about)
$request->uri->getPath();
$request->getUri()->getPath();

// Retrieve $_GET and $_POST variables
$request->getGet('foo');
Expand Down
6 changes: 3 additions & 3 deletions user_guide_src/source/incoming/incomingrequest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,13 @@ The Request URL
---------------

You can retrieve a :doc:`URI </libraries/uri>` object that represents the current URI for this request through the
``$request->uri`` property. You can cast this object as a string to get a full URL for the current request::
``$request->getUri()`` method. You can cast this object as a string to get a full URL for the current request::

$uri = (string)$request->uri;
$uri = (string) $request->getUri();

The object gives you full abilities to grab any part of the request on it's own::

$uri = $request->uri;
$uri = $request->getUri();

echo $uri->getScheme(); // http
echo $uri->getAuthority(); // snoopy:password@example.com:88
Expand Down