Request::getPathInfo PHP Method

getPathInfo() public static method

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'
public static getPathInfo ( ) : string
return string The raw path (i.e. not urldecoded)
        public static function getPathInfo()
        {
            //Method inherited from \Symfony\Component\HttpFoundation\Request
            return \Illuminate\Http\Request::getPathInfo();
        }

Usage Example

Example #1
0
 /**
  * @covers Phossa\Route\Context\Request::getPathInfo
  */
 public function testGetPathInfo()
 {
     $this->assertEquals('/user/list/1234', $this->object->getPathInfo());
     // fake stuff
     $_SERVER['REQUEST_URI'] = '/user/add/12?ddsfd=adfad';
     $_SERVER['PATH_INFO'] = '/add/12';
     $this->object = new Request('POST', '/user/list/1234?id=phossa');
     $this->assertEquals('/list/1234', $this->object->getPathInfo());
 }
All Usage Examples Of Request::getPathInfo