JOOMLA中国
  • Joomla中国首页
  • 社区
  • 教程
  • 应用市场
  • B计划
Joomla! Framework TM
  • Namespace
  • Class
  • Tree
  • Deprecated

Namespaces

  • Composer
    • Autoload
  • Joomla
    • Application
      • Cli
        • Output
          • Processor
      • Web
    • Data
    • DI
      • Exception
    • Event
    • Filter
    • Input
    • Ldap
    • Registry
      • Format
    • Session
      • Storage
    • String
    • Uri
    • Utilities
  • None
  • PasswordCompat
    • binary
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Yaml
        • Exception
    • Polyfill
      • Util

Classes

  • AbstractUri
  • Uri
  • UriHelper
  • UriImmutable

Interfaces

  • UriInterface

Class AbstractUri

Uri Class

Abstract base for out uri classes.

This class should be considered an implementation detail. Typehint against UriInterface.

Joomla\Uri\AbstractUri implements Joomla\Uri\UriInterface

Direct known subclasses

Joomla\Uri\Uri, Joomla\Uri\UriImmutable

Indirect known subclasses

JUri

Abstract
Namespace: Joomla\Uri
Since: 1.0
Located at vendor/joomla/uri/src/AbstractUri.php

Methods summary

public
# __construct( string $uri = null )

Constructor. You can pass a URI string to the constructor to initialise a specific URI.

Constructor. You can pass a URI string to the constructor to initialise a specific URI.

Parameters

$uri
string - $uri The optional URI string

Since

1.0
public string
# __toString( )

Magic method to get the string representation of the URI object.

Magic method to get the string representation of the URI object.

Returns

string

Since

1.0

Implementation of

Joomla\Uri\UriInterface::__toString()
public string
# toString( array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment') )

Returns full uri string.

Returns full uri string.

Parameters

$parts
array - $parts An array specifying the parts to render.

Returns

string - The rendered URI string.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::toString()
public boolean
# hasVar( string $name )

Checks if variable exists.

Checks if variable exists.

Parameters

$name
string - $name Name of the query variable to check.

Returns

boolean - True if the variable exists.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::hasVar()
public array
# getVar( string $name, string $default = null )

Returns a query variable by name.

Returns a query variable by name.

Parameters

$name
string - $name Name of the query variable to get.
$default
string - $default Default value to return if the variable is not set.

Returns

array - Query variables.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::getVar()
public string
# getQuery( boolean $toArray = false )

Returns flat query string.

Returns flat query string.

Parameters

$toArray
boolean - $toArray True to return the query as a key => value pair array.

Returns

string - Query string.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::getQuery()
public string
# getScheme( )

Get URI scheme (protocol) ie. http, https, ftp, etc...

Get URI scheme (protocol) ie. http, https, ftp, etc...

Returns

string - The URI scheme.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::getScheme()
public string
# getUser( )

Get URI username Returns the username, or null if no username was specified.

Get URI username Returns the username, or null if no username was specified.

Returns

string - The URI username.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::getUser()
public string
# getPass( )

Get URI password Returns the password, or null if no password was specified.

Get URI password Returns the password, or null if no password was specified.

Returns

string - The URI password.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::getPass()
public string
# getHost( )

Get URI host Returns the hostname/ip or null if no hostname/ip was specified.

Get URI host Returns the hostname/ip or null if no hostname/ip was specified.

Returns

string - The URI host.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::getHost()
public integer
# getPort( )

Get URI port Returns the port number, or null if no port was specified.

Get URI port Returns the port number, or null if no port was specified.

Returns

integer - The URI port number.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::getPort()
public string
# getPath( )

Gets the URI path string.

Gets the URI path string.

Returns

string - The URI path string.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::getPath()
public string
# getFragment( )

Get the URI archor string Everything after the "#".

Get the URI archor string Everything after the "#".

Returns

string - The URI anchor string.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::getFragment()
public boolean
# isSSL( )

Checks whether the current URI is using HTTPS.

Checks whether the current URI is using HTTPS.

Returns

boolean - True if using SSL via HTTPS.

Since

1.0

Implementation of

Joomla\Uri\UriInterface::isSSL()
protected static string
# buildQuery( array $params )

Build a query from an array (reverse of the PHP parse_str()).

Build a query from an array (reverse of the PHP parse_str()).

Parameters

$params
array - $params The array of key => value pairs to return as a query string.

Returns

string - The resulting query string.

Since

1.0

See

parse_str()
protected boolean
# parse( string $uri )

Parse a given URI and populate the class fields.

Parse a given URI and populate the class fields.

Parameters

$uri
string - $uri The URI string to parse.

Returns

boolean - True on success.

Since

1.0
protected string
# cleanPath( string $path )

Resolves //, ../ and ./ from a path and returns the result. Eg:

Resolves //, ../ and ./ from a path and returns the result. Eg:

/foo/bar/../boo.php => /foo/boo.php /foo/bar/../../boo.php => /boo.php /foo/bar/.././/boo.php => /foo/boo.php

Parameters

$path
string - $path The URI path to clean.

Returns

string - Cleaned and resolved URI path.

Since

1.0

Magic methods summary

Properties summary

protected string $uri
#

Original URI

Original URI

Since

1.0
protected string $scheme
#

Protocol

Protocol

Since

1.0
protected string $host
#

Host

Host

Since

1.0
protected integer $port
#

Port

Port

Since

1.0
protected string $user
#

Username

Username

Since

1.0
protected string $pass
#

Password

Password

Since

1.0
protected string $path
#

Path

Path

Since

1.0
protected string $query
#

Query

Query

Since

1.0
protected string $fragment
#

Anchor

Anchor

Since

1.0
protected array $vars
#

Query variable hash

Query variable hash

Since

1.0
Joomla! Framework TM API documentation generated by ApiGen 2.8.0
Joomla!® and Joomla! Framework™ are trademarks of Open Source Matters, Inc. in the United States and other countries.