PHP 클래스 Lime\Helper\Utils

상속: extends Lime\Helper
파일 보기 프로젝트 열기: sjardim/Hugopit

공개 메소드들

메소드 설명
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