From 05ce6cb92a6822177a50f479620c6dd276c15ce7 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 18 Nov 2021 09:36:14 +0900 Subject: [PATCH] docs: don't use $request->uri See #5344 --- user_guide_src/source/concepts/http.rst | 2 +- user_guide_src/source/incoming/incomingrequest.rst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/concepts/http.rst b/user_guide_src/source/concepts/http.rst index 2696c91223d3..8ae030fc1811 100644 --- a/user_guide_src/source/concepts/http.rst +++ b/user_guide_src/source/concepts/http.rst @@ -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'); diff --git a/user_guide_src/source/incoming/incomingrequest.rst b/user_guide_src/source/incoming/incomingrequest.rst index e9f494961233..d08bf8470f70 100644 --- a/user_guide_src/source/incoming/incomingrequest.rst +++ b/user_guide_src/source/incoming/incomingrequest.rst @@ -249,13 +249,13 @@ The Request URL --------------- You can retrieve a :doc:`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