Templating engine which stores objects in the slots and then arranges them on a page. More...
Public Member Functions | |
__construct ($cfg) | |
Constructor compatible with Context resources. | |
addObject ($id, $slot, $weight, $template, $data=array(), $context=null) | |
Add object to specified slot and set its weight. | |
slotOptionSet ($slot, $option, $value) | |
Set slot option (no arrays allowed) More... | |
slotOptionAppend ($slot, $option, $value) | |
Append slot option value to list. | |
addReverseRouter ($router) | |
Register reverse router for URL generator. | |
url ($route_name, $values) | |
Generate URL from route. | |
loadTemplate ($output_type, $template_name, $function_name, $indent= '') | |
Load template of given type and name. | |
isSlotEmpty ($slot_name) | |
Returns true if there are no objects in given slot (or if slot does not exist at all). | |
processSlot ($slot_name) | |
Render content of the slot to a page (stdout). | |
start ($return_output=false) | |
Start rendering. More... | |
getHttpStatusMessage ($code) | |
Convert HTTP status code to textual description (as described in RFC2616). | |
Templating engine which stores objects in the slots and then arranges them on a page.
The slot is nothing more than function which renders all objects in named array.
Templating engine also keeps track of all reverse routers – the objects which translate an object ID to URI. These are used to generate links.
slotOptionSet | ( | $slot, | |
$option, | |||
$value | |||
) |
start | ( | $return_output = false | ) |
Start rendering.
A 'root' slot will be rendered first, all other slots must be redered by objects in the 'root' slot.
A redirect can be specified using slot options (redirect_url
, redirect_code
and redirect_message
). Also a HTTP code of the response can be set (slot options http_status_code
and http_status_message
).
Slot option type
determines the set of templates used to render the objects. Note that this option can be changed in the nested slots.