View Class Reference


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

Detailed Description

Definition at line 20 of file view.php.


Constructor & Destructor Documentation

__construct ( &$  controller  ) 

constructor. copies all needed variables from the controller

Parameters:
object controller that uses this view

Definition at line 100 of file view.php.

References $controller.


Member Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
string $action name of the view
string $layout name of the layout
Returns:
string html of the view

Definition at line 155 of file view.php.

References $action, $GLOBALS, constructHelpers(), and renderLayout().

Here is the call graph for this function:

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

Parameters:
string $name name of the element (see views/elements/) without .thtml
an array of variables the element can access in global namespace

Definition at line 219 of file view.php.

References $GLOBALS, and $params.

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

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$action

Definition at line 47 of file view.php.

Referenced by render().

$base

Definition at line 59 of file view.php.

$controller [protected]

Definition at line 25 of file view.php.

Referenced by __construct().

$didConstructHelpers = false [protected]

Definition at line 94 of file view.php.

$elementName = '' [protected]

Definition at line 82 of file view.php.

$helperClasses = array() [protected]

array that holds the actual instanciated classes of all constructed helpers for this view

Definition at line 76 of file view.php.

$helpers = array("Html")

Definition at line 65 of file view.php.

$layoutName = '' [protected]

Definition at line 88 of file view.php.

$params

Definition at line 41 of file view.php.

Referenced by renderElement().

$passedVars = array()

Definition at line 71 of file view.php.

$webroot

Definition at line 53 of file view.php.


The documentation for this class was generated from the following file:

Generated on Mon Apr 27 16:29:08 2009 for kata by  doxygen 1.5.8