protected $file = '';
Represents the file part of the url - http://www.server.com/path/file.html?parameter=value
protected $path = '/';
Represents the path part of the url - http://www.server.com/path/file.html?parameter=value
$url
- URL (http://www.server.com/dir/page.php?param=value)public function __construct($url = null);
Constructor. Sets the url if $url
is given.
public function getUrl();
$url
- URL (http://www.server.com/dir/page.php?param=value)public function setUrl($url);
$params
- Additional parameters to merge. These parameters are not added to object's parameterspublic function getUri($params = array());
synonym for setUrl
public function getFile();
Returns file part of the url: http://www.server.com/path/file.html?parameter=value
$file
- file part of the urlpublic function setFile($file);
Sets file part of the url: http://www.server.com/path/file.html?parameter=value
$url = nsPageUrl::singelton(); $url->page = $page; $url->filter = $filter // ..... $localUrl = clone $url; //we don't need these in other sections $localUrl->userId = $userId; $localUrl->action = 'DeleteUser'; echo '<a href="'.$localUrl.'">delete user</a>'; $pageUrl = clone $url; $pageUrl->page = $nextPage; echo '<a href="'.$pageUrl.'">prev page</a>'; $pageUrl->page = $prevPage; echo '<a href="'.$pageUrl.'">next page</a>'; echo '<a href="'.$url.'">link to this page</a>';