Symfony\Component\HttpFoundation\Request::getUri PHP Method

getUri() public method

Generates a normalized URI (URL) for the Request.
See also: getQueryString()
public getUri ( ) : string
return string A normalized URI (URL) for the Request
    public function getUri()
    {
        if (null !== $qs = $this->getQueryString()) {
            $qs = '?'.$qs;
        }

        return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs;
    }

Usage Example

 /**
  * Creates and persists a thread with the specified id.
  *
  * @param mixed $id
  * @return ThreadInterface
  */
 public function create($id)
 {
     $thread = $this->threadManager->createThread();
     $thread->setId($id);
     $thread->setPermalink($this->request->getUri());
     $this->threadManager->addThread($thread);
     return $thread;
 }
All Usage Examples Of Symfony\Component\HttpFoundation\Request::getUri