Request::getPathInfo()

string getPathInfo()

Returns the path being requested relative to the executed script.

The path info always starts with a /.

Suppose this request is instantiated from /mysite on localhost:

  • http://localhost/mysite returns an empty string
  • http://localhost/mysite/about returns '/about'
  • http://localhost/mysite/enco%20ded returns '/enco%20ded'
  • http://localhost/mysite/about?var=1 returns '/about'

Return Value

string The raw path (i.e. not urldecoded)
doc_Symfony
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.