Request::getBasePath()

string getBasePath()

Returns the root path from which this request is executed.

Suppose that an index.php file instantiates this request object:

  • http://localhost/index.php returns an empty string
  • http://localhost/index.php/page returns an empty string
  • http://localhost/web/index.php returns '/web'
  • http://localhost/we%20b/index.php returns '/we%20b'

Return Value

string The raw path (i.e. not urldecoded)
doc_Symfony
2016-10-28 06:29:20
Comments
Leave a Comment

Please login to continue.