$test_url : supplied url to be processed
$some_url : supplied url to be compared
$Url = new Url;
path() method supplies a url to be tested.
$Url->path($test_url);
$Url->path('/user/profile/settings');
follows() method checks if a path follows a particular
url supplied. This returns a boolean value of true or false
$Url->follows($some_url);
where: $some_url is the parent url structure that must be matched
$Url->path('index')->follows('index'); // true
$Url->path('index/profile')->follows('index'); // true
$Url->path('index/profile')->follows('index/profile/user'); // false
$Url->path('index/profile')->follows('profile'); // false
$Url->isLike($some_url);
$Url->path('index')->isLike('index'); // true
$Url->path('index/profile')->isLike('index'); // true
$Url->path('index/profile/user')->isLike('index/profile'); // true
$Url->path('index/profile/me')->isLike('index/profile/you'); // false
$Url->path('index')->is('index'); // true
$Url->path('index/user', 'index/person'); //false
$Url->path('index')->in(['index', 'profile']); // true
$Url->path('index')->in(['home', 'profile']); // false
hash() method returns the hash of a string.
$Url->path('index#user');
var_dump( $Url->hash() ); //returns user
query method returns the query of a url. If query string
is found, an array is returned else, a null value is returned
$Url->path("http://site.com/user?name=foo&class=bar");
var_dump( $Url->query() ); //['name'=>'foo', 'class' => 'bar']