Public Member Functions | |
| __construct (&$controller) | |
| render ($action, $layout) | |
| renderLayout ($contentForLayout, $layout) | |
| renderElement ($name, $params=array()) | |
Data Fields | |
| $params | |
| $action | |
| $webroot | |
| $base | |
| $helpers = array("Html") | |
| $passedVars = array() | |
Protected Member Functions | |
| constructHelpers () | |
Protected Attributes | |
| $controller | |
| $helperClasses = array() | |
| $elementName = '' | |
| $layoutName = '' | |
| $didConstructHelpers = false | |
Definition at line 20 of file view.php.
| __construct | ( | &$ | controller | ) |
constructor. copies all needed variables from the controller
| object | controller that uses this view |
Definition at line 100 of file view.php.
References $controller.
| constructHelpers | ( | ) | [protected] |
construct all helpers we found in our helpers property
Definition at line 113 of file view.php.
References classRegistry::getObject(), and kataUse().
Referenced by render(), and renderLayout().


| render | ( | $ | action, | |
| $ | layout | |||
| ) |
render the actual view and layout. normally done at the end of a action of a controller 1. all helpers are constructed here, very late, so we dont accidently waste cpu cycles 2. all variables, helpers and params given from the controller are extracted to global namespace 3. the actual view-template is rendered 4. the content of the rendered view is rendered into the layout
| string | $action name of the view | |
| string | $layout name of the layout |
Definition at line 155 of file view.php.
References $action, $GLOBALS, constructHelpers(), and renderLayout().

| renderElement | ( | $ | name, | |
| $ | params = array() | |||
| ) |
render a element and return the resulting html. an element is kind of like a mini-view you can use inside a view (via $this->renderElement()). it has (like a view) access to all variables a normal view has
| string | $name name of the element (see views/elements/) without .thtml | |
| an | array of variables the element can access in global namespace |
| renderLayout | ( | $ | contentForLayout, | |
| $ | layout | |||
| ) |
renders the given string into the layout. normally called by renderView() 1. title and content are extracted into global namespace 2. all variables, helpers and params given from the controller are extracted to global namespace 3. the given string is rendered into the layout 4. the html-output of this routine normally lands in the controllers output property
| string | $contentForLayout raw html to be rendered to the layout (normally the content of a view) | |
| string | $layout name of the layout |
Definition at line 191 of file view.php.
References $GLOBALS, and constructHelpers().
Referenced by render().


$controller [protected] |
$helperClasses = array() [protected] |
| $params |
1.5.8