Class rex_fragment

Package: redaxo\core
Located at redaxo/src/core/lib/fragment.php

Methods summary

public
# __construct( array $vars = [] )

Creates a fragment with the given variables.

public mixed
# getVar( string $name, string $default = null )

Returns the value of the given variable $name.

public mixed
# setVar( string $name, mixed $value, boolean $escape = true )

Set the variable $name to the given value.

public string
# parse( string $filename )

Parses the variables of the fragment into the file $filename.

public mixed
# decorate( string $filename, array $params )

Decorate the current fragment, with another fragment. The decorated fragment receives the parameters which are passed to this method.

protected mixed
# escape( mixed $value, string $strategy = 'html' )

Escapes the value $val for proper use in the gui.

protected
# subfragment( string $filename, array $params = [] )

Include a Subfragment from within a fragment.

protected string
# i18n( string $key )

Translate the given key $key.

public mixed
# __get( string $name )

Magic getter to reference variables from within the fragment.

public boolean
# __isset( string $name )

Magic method to check if a variable is set.

public static
# addDirectory( string $dir )

Add a path to the fragment search path.