PHP 클래스 Bolt\Twig\Handler\TextHandler

파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Silex\Application $app )
jsonDecode ( string $string ) : array JSON decodes a variable. Twig has a built-in json_encode filter, but no built-in function to JSON decode a string. This functionality remedies that.
localeDateTime ( string | DateTime $dateTime, string $format = '%B %e, %Y %H:%M' ) : string Returns the date time in a particular format. Takes the locale into account.
pregReplace ( string $str, string $pattern, string $replacement = '', integer $limit ) : string Perform a regular expression search and replace on the given string.
safeString ( string $str, boolean $strict = false, string $extrachars = '' ) : string Return a 'safe string' version of a given string.
slug ( string $str ) : string Return the 'sluggified' version of a string.
testJson ( string $string ) : boolean Test whether a passed string contains valid JSON.

메소드 상세

__construct() 공개 메소드

public __construct ( Silex\Application $app )
$app Silex\Application

jsonDecode() 공개 메소드

JSON decodes a variable. Twig has a built-in json_encode filter, but no built-in function to JSON decode a string. This functionality remedies that.
public jsonDecode ( string $string ) : array
$string string The string to decode.
리턴 array The JSON decoded array

localeDateTime() 공개 메소드

Returns the date time in a particular format. Takes the locale into account.
public localeDateTime ( string | DateTime $dateTime, string $format = '%B %e, %Y %H:%M' ) : string
$dateTime string | DateTime
$format string
리턴 string Formatted date and time

pregReplace() 공개 메소드

Perform a regular expression search and replace on the given string.
public pregReplace ( string $str, string $pattern, string $replacement = '', integer $limit ) : string
$str string
$pattern string
$replacement string
$limit integer
리턴 string Same string where first character is in upper case

safeString() 공개 메소드

Return a 'safe string' version of a given string.
또한 보기: function Bolt\Library::safeString()
public safeString ( string $str, boolean $strict = false, string $extrachars = '' ) : string
$str string
$strict boolean
$extrachars string
리턴 string

slug() 공개 메소드

Return the 'sluggified' version of a string.
public slug ( string $str ) : string
$str string input value
리턴 string Slug safe version of the string

testJson() 공개 메소드

Test whether a passed string contains valid JSON.
public testJson ( string $string ) : boolean
$string string The string to test.
리턴 boolean