Horde_Core_Smartmobile_Url::__construct PHP Method

__construct() public method

Constructor.
public __construct ( Horde_Url $url = null, boolean $raw = null )
$url Horde_Url The basic URL.
$raw boolean 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);
    }
Horde_Core_Smartmobile_Url