———
|
Table of Contents
nsPageUrlMembersurlurifileprotected $file = ''; Represents the file part of the url - http://www.server.com/path/file.html?parameter=value pathprotected $path = '/'; Represents the path part of the url - http://www.server.com/path/file.html?parameter=value MethodsConstructor
public function __construct($url = null);
Constructor. Sets the url if getUrl
public function getUrl(); setUrl
public function setUrl($url); getUri
public function getUri($params = array()); setUrisynonym for setUrl getFile
public function getFile(); Returns file part of the url: http://www.server.com/path/file.html?parameter=value setFile
public function setFile($file); Sets file part of the url: http://www.server.com/path/file.html?parameter=value ExamplesExample 1$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>'; |