Class

Symfony\Component\Templating\TemplateReference

class TemplateReference implements TemplateReferenceInterface

Internal representation of a template.

Methods

__construct($name = null, $engine = null)

__toString()

TemplateReferenceInterface set(string $name, string $value)

Sets a template parameter.

string get(string $name)

Gets a template parameter.

array all()

Gets the template parameters.

string getPath()

Returns the path to the template.

string getLogicalName()

Returns the "logical" template name.

Details

at line 25
public __construct($name = null, $engine = null)

Parameters

$name
$engine

at line 33
public __toString()

at line 50
public TemplateReferenceInterface set(string $name, string $value)

Sets a template parameter.

Parameters

string $name The parameter name
string $value The parameter value

Return Value

TemplateReferenceInterface The TemplateReferenceInterface instance

Exceptions

InvalidArgumentException if the parameter is not defined

at line 72
public string get(string $name)

Gets a template parameter.

Parameters

string $name The parameter name

Return Value

string The parameter value

Exceptions

InvalidArgumentException if the parameter is not defined

at line 88
public array all()

Gets the template parameters.

Return Value

array An array of parameters

at line 102
public string getPath()

Returns the path to the template.

By default, it just returns the template name.

Return Value

string A path to the template or a resource

at line 116
public string getLogicalName()

Returns the "logical" template name.

The template name acts as a unique identifier for the template.

Return Value

string The template name