| METHODS | |
|---|---|
__construct()
| constructor. |
render()
| renders a template. |
setHelperSet()
| sets a helper value. |
getHelperSet()
| gets all helper values. |
__get()
| gets a helper value. |
extend()
| decorates the current template with another one. |
start()
| starts a new slot. |
stop()
| stops a slot. |
has()
| returns true if the slot exists. |
get()
| gets the slot value. |
set()
| sets a slot value. |
output()
| outputs a slot. |
escape()
| escapes a string by using the current charset. |
setCharset()
| sets the charset to use. |
getCharset()
| gets the current charset. |
Constructor.
| ARGUMENTS | |
|---|---|
$loader |
A loader instance |
$renderers |
An array of renderer instances |
$helperSet |
A helper set instance |
Renders a template.
| ARGUMENTS | |
|---|---|
$name |
A template logical name |
$parameters |
An array of parameters to pass to the template |
returns The evaluated template as a string
throws InvalidArgumentException if the renderer does not exist or if the template does not exist
Sets a helper value.
| ARGUMENTS | |
|---|---|
$name |
The helper name |
$value |
The helper value |
Gets all helper values.
returns An array of all helper values
Gets a helper value.
| ARGUMENTS | |
|---|---|
$name |
The helper name |
returns The helper value
throws InvalidArgumentException if the helper is not defined
Decorates the current template with another one.
| ARGUMENTS | |
|---|---|
$template |
The decorator logical name |
Starts a new slot.
This method starts an output buffer that will be
closed when the stop() method is called.
| ARGUMENTS | |
|---|---|
$name |
The slot name |
throws InvalidArgumentException if a slot with the same name is already started
Stops a slot.
throws LogicException if no slot has been started
Returns true if the slot exists.
| ARGUMENTS | |
|---|---|
$name |
The slot name |
Gets the slot value.
| ARGUMENTS | |
|---|---|
$name |
The slot name |
$default |
The default slot content |
returns The slot content
Sets a slot value.
| ARGUMENTS | |
|---|---|
$name |
The slot name |
$content |
The slot content |
Outputs a slot.
| ARGUMENTS | |
|---|---|
$name |
The slot name |
$default |
The default slot content |
returns true if the slot is defined or if a default content has been provided, false otherwise
Escapes a string by using the current charset.
| ARGUMENTS | |
|---|---|
$value |
A string to escape |
returns The escaped string or the original value if not a string
Sets the charset to use.
| ARGUMENTS | |
|---|---|
$charset |
The charset |
Gets the current charset.
returns The current charset
