[[nsPageUrl]]
 

———

 
Translations of this page:

nsPageUrl

Members

url

    protected $url = '';

uri

    protected $uri = '';

file

    protected $file = '';

Represents the file part of the url - http://www.server.com/path/file.html?parameter=value

path

    protected $path = '/';

Represents the path part of the url - http://www.server.com/path/file.html?parameter=value

Methods

Constructor

    public function __construct($url = null);

Constructor. Sets the url if $url is given.

getUrl

    public function getUrl();

setUrl

    public function setUrl($url);

getUri

    public function getUri($params = array());

setUri

synonym for setUrl

getFile

  • return value: file part of the url
    public function getFile();

Returns file part of the url: http://www.server.com/path/file.html?parameter=value

setFile

  • $file - file part of the url
  • return value: -
    public function setFile($file);

Sets file part of the url: http://www.server.com/path/file.html?parameter=value

Examples

Example 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>';
 
nscl/c-nspageurl.txt · Last modified: 09.01.2008 23:39 by npelov
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki