PHP 클래스 rex_fragment, redaxo

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

공개 메소드들

메소드 설명
__construct ( array $vars = [] ) Creates a fragment with the given variables.
__get ( string $name ) : mixed Magic getter to reference variables from within the fragment.
__isset ( string $name ) : boolean Magic method to check if a variable is set.
addDirectory ( string $dir ) Add a path to the fragment search path.
decorate ( string $filename, array $params ) Decorate the current fragment, with another fragment.
getVar ( string $name, string $default = null ) Returns the value of the given variable $name.
parse ( string $filename, boolean $delete_whitespaces = true ) : string Parses the variables of the fragment into the file $filename.
setVar ( string $name, mixed $value, boolean $escape = true ) Set the variable $name to the given value.

보호된 메소드들

메소드 설명
escape ( mixed $val ) : mixed Escapes the value $val for proper use in the gui.
i18n ( string $key ) : string Translate the given key $key.
subfragment ( string $filename, array $params = [] ) Include a Subfragment from within a fragment.

메소드 상세

__construct() 공개 메소드

Creates a fragment with the given variables.
public __construct ( array $vars = [] )
$vars array A array of key-value pairs to pass as local parameters

__get() 공개 메소드

Magic getter to reference variables from within the fragment.
public __get ( string $name ) : mixed
$name string The name of the variable to get
리턴 mixed

__isset() 공개 메소드

Magic method to check if a variable is set.
public __isset ( string $name ) : boolean
$name string The name of the variable to check
리턴 boolean

addDirectory() 공개 정적인 메소드

Add a path to the fragment search path.
public static addDirectory ( string $dir )
$dir string A path to a directory where fragments can be found

decorate() 공개 메소드

The decorated fragment receives the parameters which are passed to this method.
public decorate ( string $filename, array $params )
$filename string The filename of the fragment used for decoration
$params array A array of key-value pairs to pass as parameters

escape() 보호된 메소드

Escapes the value $val for proper use in the gui.
protected escape ( mixed $val ) : mixed
$val mixed the value to escape
리턴 mixed

getVar() 공개 메소드

Returns the value of the given variable $name.
public getVar ( string $name, string $default = null )
$name string Variable name
$default string Default value

i18n() 보호된 메소드

Translate the given key $key.
protected i18n ( string $key ) : string
$key string The key to translate
리턴 string

parse() 공개 메소드

Parses the variables of the fragment into the file $filename.
public parse ( string $filename, boolean $delete_whitespaces = true ) : string
$filename string the filename of the fragment to parse
$delete_whitespaces boolean
리턴 string

setVar() 공개 메소드

Set the variable $name to the given value.
public setVar ( string $name, mixed $value, boolean $escape = true )
$name string The name of the variable
$value mixed The value for the variable
$escape boolean Flag which indicates if the value should be escaped or not

subfragment() 보호된 메소드

The Subfragment gets all variables of the current fragment, plus optional overrides from $params
protected subfragment ( string $filename, array $params = [] )
$filename string The filename of the fragment to use
$params array A array of key-value pairs to pass as local parameters