PHP Class Microweber\Providers\URLify

Handles symbols from Latin languages, Greek, Turkish, Russian, Ukrainian, Czech, Polish, and Latvian. Symbols it cannot transliterate it will simply omit. Usage: echo URLify::filter (' J\'étudie le français '); "jetudie-le-francais" echo URLify::filter ('Lo siento, no hablo español.'); "lo-siento-no-hablo-espanol"
Show file Open project: microweber/microweber

Public Properties

Property Type Description
$maps
$remove_list List of words to remove from URLs.

Public Methods

Method Description
add_chars ( $map ) Add new characters to the list.
downcode ( $text ) Transliterates characters to their ASCII equivalents.
filter ( $text, $length = 60 ) Filters a string, e.g., "Petty theft" to "petty-theft".
remove_words ( $words ) Append words to the remove list.
transliterate ( $text ) Alias of URLify::downcode().

Private Methods

Method Description
init ( ) Initializes the character map.

Method Details

add_chars() public static method

$map should be a hash.
public static add_chars ( $map )

downcode() public static method

Transliterates characters to their ASCII equivalents.
public static downcode ( $text )

filter() public static method

Filters a string, e.g., "Petty theft" to "petty-theft".
public static filter ( $text, $length = 60 )

remove_words() public static method

Accepts either single words or an array of words.
public static remove_words ( $words )

transliterate() public static method

Alias of URLify::downcode().
public static transliterate ( $text )

Property Details

$maps public static property

public static $maps

$remove_list public static property

List of words to remove from URLs.
public static $remove_list