tdt/uri

Did you ever try to get the current URI in PHP? This should do the trick.

dev-master 2013-06-19 17:53 UTC

This package is auto-updated.

Last update: 2024-11-29 04:29:22 UTC


README

Ever wanted to get the right request URI/URL in PHP? This should do the trick

API

$ruri = $RequestURI::getInstance();
$ruri->getProtocol(); //returns http or https
$ruri->getHostname(); //returns the hostname
$ruri->getFilters(); //return the path as an array
$ruri->getGET(); //all GET parameters in an associative array
$ruri->getGivenFormat(); //when you add a .json to the end of the URI
$ruri->getRealWorldObjectURI(); //return URI without a format or without GET params
$ruri->getResourcePath(); //the path to the resource
$ruri->getURI(); //realworld object URI plus format and get params. The full URI.