__construct() public method

Constructor.
public __construct ( string | Horde_Url $url = '', boolean $raw = null )
$url string | Horde_Url The basic URL, with or without query parameters.
$raw boolean Whether to output the URL in the raw URL format or HTML-encoded.
Exemplo n.º 1
0
 /**
  * Constructor.
  *
  * @param Horde_Url $url   The basic URL.
  * @param boolean $raw     Whether to output the URL in the raw URL format
  *                         or HTML-encoded.
  */
 public function __construct($url = null, $raw = null)
 {
     if (is_null($url)) {
         $url = new Horde_Url();
     }
     if (!$url instanceof Horde_Url) {
         throw new InvalidArgumentException('First argument to Horde_Core_Smartmobile_Url constructor must be a Horde_Url object');
     }
     $query = '';
     /* Smartmobile URLs carry around query information in fragment, so
      * copy any information found in the incoming URL. */
     if (strlen($url->anchor)) {
         $anchor = parse_url($url->anchor);
         if (isset($anchor['query'])) {
             $this->anchor = $anchor['path'];
             $query = '?' . $anchor['query'];
         } else {
             $this->anchor = $url->anchor;
         }
         $url->anchor = '';
     }
     $this->_baseUrl = $url;
     parent::__construct($query, $raw);
 }