PHP Класс Lime\Helper\Utils

Наследование: extends Lime\Helper
Показать файл Открыть проект

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

Метод Описание
fixRelativeUrls ( $content, $base = '/' )
formatSize ( $size )
gravatar ( $email, $size = 40 )
resolveDependencies ( array $data ) : array resolves complicated dependencies to determine what order something can run in
safe_truncate ( string $string, integer $length, string $append = '...' ) : string Truncate a string to a specified length without cutting a word off.
sluggify ( $string, $replacement = '-', $tolower = true )
str_to_bool ( string $string, boolean $default = false ) : boolean Converts many english words that equate to true or false to boolean.

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

fixRelativeUrls() публичный Метод

public fixRelativeUrls ( $content, $base = '/' )

formatSize() публичный Метод

public formatSize ( $size )

gravatar() публичный Метод

public gravatar ( $email, $size = 40 )

resolveDependencies() публичный Метод

start with an array like: array( 'a' => array('b', 'c'), 'b' => array(), 'c' => array('b') ) a depends on b and c, c depends on b, and b depends on nobody in this case we would return array('b', 'c', 'a')
public resolveDependencies ( array $data ) : array
$data array
Результат array

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

Truncate a string to a specified length without cutting a word off.
public static safe_truncate ( string $string, integer $length, string $append = '...' ) : string
$string string The string to truncate
$length integer The length to truncate the string to
$append string Text to append to the string IF it gets truncated, defaults to '...'
Результат string

sluggify() публичный Метод

public sluggify ( $string, $replacement = '-', $tolower = true )

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

Supports 'y', 'n', 'yes', 'no' and a few other variations.
public static str_to_bool ( string $string, boolean $default = false ) : boolean
$string string The string to convert to boolean
$default boolean The value to return if we can't match any yes/no words
Результат boolean