$di
$di : \Anax\DI\Anax\DI\DIInterface
A view collection supporting Anax DI, store all views per region, render at will.
getConfig(string $key, string $default = null) : mixed
Helper function for reading values from the configuration and appy default values where configuration item is missing.
| string | $key | matching a key in the config array. |
| string | $default | value returned when config item is not found. |
or null if key does not exists.
add(string $template, array $data = array(), string $region = "main", integer $sort) : self
Add (create) a view to be included, pass optional data and put the view in an optional specific region (default region is "main") and pass an optional sort value where the highest value is rendered first.
The $template can be a: filename (string), callback (array with key callback set to a callable array), view array (key value array with template, data, region, sort)
| string | $template | the name of the template file to include. |
| array | $data | variables to make available to the view, default is empty. |
| string | $region | which region to attach the view, default is "main". |
| integer | $sort | which order to display the views. |
for chaining.
addCallback(string $callback, array $data = array(), string $region = "main", integer $sort) : $this
Add a callback to be rendered as a view.
| string | $callback | function to call to get the content of the view |
| array | $data | variables to make available to the view, default is empty |
| string | $region | which region to attach the view |
| integer | $sort | which order to display the views |