PHP Class url, kirby

Afficher le fichier Open project: bastianallgeier/kirby Class Usage Examples

Méthodes publiques

Méthode Description
current ( ) : string Returns the current URL
has_query ( string $url ) : boolean Checks if the URL has a query string attached
short ( string $url, integer $chars = false, boolean $base = false, string $rep = '…' ) : string Shortens an URL It removes http:// or https:// and uses str::short afterwards
strip_hash ( string $url ) : string Strips a hash value from the URL
strip_query ( string $url ) : string Strips the query from the URL
valid ( string $url ) : boolean Checks for a valid URL

Method Details

current() static public méthode

Returns the current URL
static public current ( ) : string
Résultat string

has_query() static public méthode

Checks if the URL has a query string attached
static public has_query ( string $url ) : boolean
$url string
Résultat boolean

short() static public méthode

Shortens an URL It removes http:// or https:// and uses str::short afterwards
static public short ( string $url, integer $chars = false, boolean $base = false, string $rep = '…' ) : string
$url string The URL to be shortened
$chars integer The final number of characters the URL should have
$base boolean True: only take the base of the URL.
$rep string The element, which should be added if the string is too long. Ellipsis is the default.
Résultat string The shortened URL

strip_hash() static public méthode

Strips a hash value from the URL
static public strip_hash ( string $url ) : string
$url string
Résultat string

strip_query() static public méthode

Strips the query from the URL
static public strip_query ( string $url ) : string
$url string
Résultat string

valid() static public méthode

Checks for a valid URL
static public valid ( string $url ) : boolean
$url string
Résultat boolean