PHP Class Purl\Url

Author: Jonathan H. Wage ([email protected])
Inheritance: extends purl\AbstractPart
Afficher le fichier Open project: jwage/purl Class Usage Examples

Protected Properties

Свойство Type Description
$data array
$partClassMap array

Méthodes publiques

Méthode Description
__construct ( string $url = null, purl\ParserInterface $parser = null ) Construct a new Url instance.
__toString ( )
extract ( string $string ) : array Extracts urls from a string of text.
fromCurrent ( ) : Url Creates an Url instance based on data available on $_SERVER variable.
getFragment ( ) : purl\Fragment Get the Fragment instance.
getNetloc ( ) : string Gets the netloc part of the Url. It is the user, pass, host and port returned as a string.
getParser ( ) : purl\ParserInterface Gets the ParserInterface instance used to parse this Url instance.
getPath ( ) : purl\Path Get the Path instance.
getQuery ( ) : Query Get the Query instance.
getUrl ( ) : string Builds a string url from this Url instance internal data and returns it.
isAbsolute ( ) : boolean Checks if the Url instance is absolute or not.
join ( Url | string $url ) : Url Join this Url instance together with another Url instance or a string url.
parse ( string $url ) : Url Static convenience method for creating a new Url instance.
set ( $key, $value )
setFragment ( purl\Fragment $fragment ) Set the Fragment instance.
setParser ( purl\ParserInterface $parser ) Sets the ParserInterface instance to use to parse this Url instance.
setPath ( purl\Path $path ) Set the Path instance.
setQuery ( Query $query ) Set the Query instance.
setUrl ( $url ) Set the string url for this Url instance and sets initialized to false.

Méthodes protégées

Méthode Description
doInitialize ( )

Private Methods

Méthode Description
createDefaultParser ( ) : Parser Creates the default Parser instance to parse urls.
httpBuildRelativeUrl ( array $parts ) : string Reconstructs relative part of URL from an array of parts.
httpBuildUrl ( array $parts ) : string Reconstructs a string URL from an array of parts.

Method Details

__construct() public méthode

Construct a new Url instance.
public __construct ( string $url = null, purl\ParserInterface $parser = null )
$url string
$parser purl\ParserInterface

__toString() public méthode

public __toString ( )

doInitialize() protected méthode

protected doInitialize ( )

extract() public static méthode

Extracts urls from a string of text.
public static extract ( string $string ) : array
$string string
Résultat array $urls

fromCurrent() public static méthode

Creates an Url instance based on data available on $_SERVER variable.
public static fromCurrent ( ) : Url
Résultat Url

getFragment() public méthode

Get the Fragment instance.
public getFragment ( ) : purl\Fragment
Résultat purl\Fragment

getNetloc() public méthode

Gets the netloc part of the Url. It is the user, pass, host and port returned as a string.
public getNetloc ( ) : string
Résultat string

getParser() public méthode

Gets the ParserInterface instance used to parse this Url instance.
public getParser ( ) : purl\ParserInterface
Résultat purl\ParserInterface

getPath() public méthode

Get the Path instance.
public getPath ( ) : purl\Path
Résultat purl\Path

getQuery() public méthode

Get the Query instance.
public getQuery ( ) : Query
Résultat Query

getUrl() public méthode

Builds a string url from this Url instance internal data and returns it.
public getUrl ( ) : string
Résultat string

isAbsolute() public méthode

Checks if the Url instance is absolute or not.
public isAbsolute ( ) : boolean
Résultat boolean

join() public méthode

Join this Url instance together with another Url instance or a string url.
public join ( Url | string $url ) : Url
$url Url | string
Résultat Url

parse() public static méthode

Static convenience method for creating a new Url instance.
public static parse ( string $url ) : Url
$url string
Résultat Url

set() public méthode

public set ( $key, $value )

setFragment() public méthode

Set the Fragment instance.
public setFragment ( purl\Fragment $fragment )
$fragment purl\Fragment

setParser() public méthode

Sets the ParserInterface instance to use to parse this Url instance.
public setParser ( purl\ParserInterface $parser )
$parser purl\ParserInterface

setPath() public méthode

Set the Path instance.
public setPath ( purl\Path $path )
$path purl\Path

setQuery() public méthode

Set the Query instance.
public setQuery ( Query $query )
$query Query

setUrl() public méthode

Set the string url for this Url instance and sets initialized to false.
public setUrl ( $url )

Property Details

$data protected_oe property

protected array $data
Résultat array

$partClassMap protected_oe property

protected array $partClassMap
Résultat array