Skip to content

Uri: withPath Example

Terry L edited this page Jun 18, 2020 · 3 revisions

withPath($path)

  • param string path * The path to use with the new instance.
  • return static

Example:

echo $uri->getPath();
// Outputs: /post/

$uri = $uri->withPath('/new-path');
echo $uri->getPath();
// Outputs: /new-path
Clone this wiki locally