PHP Класс Pop\Filter\String

Автор: Nick Sagona, III ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
between ( string $string, integer $start, integer $end ) : string Method to return a substring of the string between two delimiters.
camelCaseToDash ( string $string ) : string Method to convert the string from camelCase to dash format
camelCaseToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string Method to convert the string from camelCase to separator format
camelCaseToUnderscore ( string $string ) : string Method to convert the string from camelCase to under_score format
clean ( string $string, boolean $html = false ) : string Method to clean the string of any of the standard MS Word based characters and return the newly edited string
dashToCamelcase ( string $string ) : string Method to convert the string from dash to camelCase format
dashToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string Method to convert the string from dash to separator format
dashToUnderscore ( string $string ) : string Method to convert the string from dash to under_score format
dosToUnix ( string $string ) : string Method to convert newlines from DOS to UNIX
escape ( string $string, boolean $all = false ) : string Method to simulate escaping a string for DB entry, much like mysql_real_escape_string(), but without requiring a DB connection.
links ( string $string, boolean $target = false ) : string Method to convert any links in the string to clickable HTML links.
random ( integer $length, integer $type = String::ALL, integer $case = String::MIXED ) : string Method to generate a random alphanumeric string of a predefined length.
slug ( string $string, string $sep = null ) : string Method to convert the string into an SEO-friendly slug.
underscoreToCamelcase ( string $string ) : string Method to convert the string from under_score to camelCase format
underscoreToDash ( string $string ) : string Method to convert the string from under_score to dash format
underscoreToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string Method to convert the string from under_score to separator format
unixToDos ( string $string ) : string Method to convert newlines from UNIX to DOS

Защищенные методы

Метод Описание
convertCamelCase ( string $string, string $sep ) : string Method to convert a camelCase string using the $sep value passed

Описание методов

between() публичный статический Метод

Method to return a substring of the string between two delimiters.
public static between ( string $string, integer $start, integer $end ) : string
$string string
$start integer
$end integer
Результат string

camelCaseToDash() публичный статический Метод

Method to convert the string from camelCase to dash format
public static camelCaseToDash ( string $string ) : string
$string string
Результат string

camelCaseToSeparator() публичный статический Метод

Method to convert the string from camelCase to separator format
public static camelCaseToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string
$string string
$sep string
Результат string

camelCaseToUnderscore() публичный статический Метод

Method to convert the string from camelCase to under_score format
public static camelCaseToUnderscore ( string $string ) : string
$string string
Результат string

clean() публичный статический Метод

Method to clean the string of any of the standard MS Word based characters and return the newly edited string
public static clean ( string $string, boolean $html = false ) : string
$string string
$html boolean
Результат string

convertCamelCase() защищенный статический Метод

Method to convert a camelCase string using the $sep value passed
protected static convertCamelCase ( string $string, string $sep ) : string
$string string
$sep string
Результат string

dashToCamelcase() публичный статический Метод

Method to convert the string from dash to camelCase format
public static dashToCamelcase ( string $string ) : string
$string string
Результат string

dashToSeparator() публичный статический Метод

Method to convert the string from dash to separator format
public static dashToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string
$string string
$sep string
Результат string

dashToUnderscore() публичный статический Метод

Method to convert the string from dash to under_score format
public static dashToUnderscore ( string $string ) : string
$string string
Результат string

dosToUnix() публичный статический Метод

Method to convert newlines from DOS to UNIX
public static dosToUnix ( string $string ) : string
$string string
Результат string

escape() публичный статический Метод

The parameter $all is boolean flag that, when set to true, causes the '%' and '_' characters to be escaped as well.
public static escape ( string $string, boolean $all = false ) : string
$string string
$all boolean
Результат string

random() публичный статический Метод

Method to generate a random alphanumeric string of a predefined length.
public static random ( integer $length, integer $type = String::ALL, integer $case = String::MIXED ) : string
$length integer
$type integer
$case integer
Результат string

slug() публичный статический Метод

Method to convert the string into an SEO-friendly slug.
public static slug ( string $string, string $sep = null ) : string
$string string
$sep string
Результат string

underscoreToCamelcase() публичный статический Метод

Method to convert the string from under_score to camelCase format
public static underscoreToCamelcase ( string $string ) : string
$string string
Результат string

underscoreToDash() публичный статический Метод

Method to convert the string from under_score to dash format
public static underscoreToDash ( string $string ) : string
$string string
Результат string

underscoreToSeparator() публичный статический Метод

Method to convert the string from under_score to separator format
public static underscoreToSeparator ( string $string, string $sep = DIRECTORY_SEPARATOR ) : string
$string string
$sep string
Результат string

unixToDos() публичный статический Метод

Method to convert newlines from UNIX to DOS
public static unixToDos ( string $string ) : string
$string string
Результат string