protected function createUri($url)
	{
		if ($url instanceof Uri)
		{
			return $url;
		}

		// Create full URL if we are only appending variables to it
		if (substr($url, 0, 1) == '&')
		{
			$vars = array();

			if (strpos($url, '&amp;') !== false)
			{
				$url = str_replace('&amp;', '&', $url);
			}

			parse_str($url, $vars);

			$vars = array_merge($this->vars(), $vars);

			foreach ($vars as $key => $var)
			{
				if ($var == '')
				{
					unset($vars[$key]);
				}
			}

			$url = 'index.php?' . urldecode(http_build_query($vars, '', '&'));
		}

		return new Uri($url);
	}
protected function createUri($url)
	{
		if ($url instanceof Uri)
		{
			return $url;
		}

		// Create full URL if we are only appending variables to it
		if (substr($url, 0, 1) == '&')
		{
			$vars = array();

			if (strpos($url, '&amp;') !== false)
			{
				$url = str_replace('&amp;', '&', $url);
			}

			parse_str($url, $vars);

			$vars = array_merge($this->vars(), $vars);

			foreach ($vars as $key => $var)
			{
				if ($var == '')
				{
					unset($vars[$key]);
				}
			}

			$url = 'index.php?' . urldecode(http_build_query($vars, '', '&'));
		}

		return new Uri($url);
	}
protected function createUri ( $ url ) { if ( $ url instanceof Uri ) { return $ url ; } // Create full URL if we are only appending variables to it if ( substr ( $ url , 0 , 1 ) == '&' ) { $ vars = array ( ) ; if ( strpos ( $ url , '&amp;' ) !== false ) { $ url = str_replace ( '&amp;' , '&' , $ url ) ; } parse_str ( $ url , $ vars ) ; $ vars = array_merge ( $ this -> vars ( ) , $ vars ) ; foreach ( $ vars as $ key => $ var ) { if ( $ var == '' ) { unset ( $ vars [ $ key ] ) ; } } $ url = 'index.php?' . urldecode ( http_build_query ( $ vars , '' , '&' ) ) ; } return new Uri ( $ url ) ; }
Create a uri based on a full or partial url string

@param   string  $url  The URI
@return  object
Create a uri based on a full or partial url string