Controller Class Reference

Inheritance diagram for Controller:

Inheritance graph
[legend]

Public Member Functions

 __construct ()
 _constructClasses ()
 _constructComponents (&$object)
 render ($action, $layout=false)
renderView ($action, $layout=null)
renderCachedHtml ($html, $layout=null)
 redirect ($url, $status=null, $die=true)
 setPageTitle ($n)
 set ($name, $value=null)
 setRef ($name, &$value)
 get ($name)
 log ($what, $where)
 beforeRender ()
 beforeAction ()
 beforeFilter ()
 afterFilter ()

Data Fields

 $uses = array()
 $helpers = array('html')
 $components = array()
 $cache = null
 $layout = 'default'
 $autoRender = true
 $params = null
 $output = ''
 $viewVars = array()
 $action
 $webroot
 $basePath
 $base
 $pageTitle = ''
 $view = 'View'

Protected Member Functions

 initViewClass ()

Protected Attributes

 $viewClass = null

Detailed Description

Definition at line 21 of file controller.php.


Constructor & Destructor Documentation

__construct (  ) 

constructor. builds an array of all models, components and helpers this controller (including the ones of the appController) needs.

Definition at line 120 of file controller.php.

References $uses.


Member Function Documentation

_constructClasses (  ) 

loads all models this controller needs

Definition at line 169 of file controller.php.

References _constructComponents(), classRegistry::getObject(), kataUse(), and loadModel().

Here is the call graph for this function:

_constructComponents ( &$  object  ) 

loads all components this controller needs

Parameters:
object $object the class-handle of the current controller

Definition at line 186 of file controller.php.

References classRegistry::getObject().

Referenced by _constructClasses().

Here is the call graph for this function:

Here is the caller graph for this function:

afterFilter (  ) 

Called just after the view was rendered. Is never called if autoRender is false. Can be used to manipulate the views contents in the controllers output-property

Reimplemented in ScaffoldController.

Definition at line 376 of file controller.php.

Referenced by renderView().

Here is the caller graph for this function:

beforeAction (  ) 

call this after the controller has been initialized (read: models, components etc contructed) and we are about to call the myaction() method of the controller

Reimplemented in ScaffoldController.

Definition at line 363 of file controller.php.

References beforeRender().

Here is the call graph for this function:

beforeFilter (  ) 

Called just before the view is rendered. Is never called if autoRender is false

Reimplemented in ScaffoldController.

Definition at line 370 of file controller.php.

Referenced by renderView().

Here is the caller graph for this function:

beforeRender (  ) 

deprecated. use beforeAction() everywhere

Deprecated:
07.01.2009

Definition at line 357 of file controller.php.

Referenced by beforeAction().

Here is the caller graph for this function:

get ( name  ) 

Get a variable that's available inside the view. The given name-string is the name of the global variable inside the view.

Parameters:
string $name name of the variable
Returns:
mixed

Definition at line 334 of file controller.php.

initViewClass (  )  [protected]

include and instanciate view-class

Definition at line 213 of file controller.php.

References kataUse().

Referenced by renderCachedHtml(), and renderView().

Here is the call graph for this function:

Here is the caller graph for this function:

log ( what,
where 
)

shortcut to writeLog

Parameters:
string $what what text to log
int $where where to log (KATA_DEBUG OR KATA_ERROR)

Definition at line 349 of file controller.php.

References writeLog().

Here is the call graph for this function:

redirect ( url,
status = null,
die = true 
)

redirect to the given url. if relative the base-url to the framework is added.

Parameters:
string $url to redirect to
int $status http status-code to use for redirection (default 303=get the new url via GET even if this page was reached via POST)
bool $die if we should die() after redirect (default: true);

Definition at line 264 of file controller.php.

Referenced by ScaffoldController::delete(), ScaffoldController::insert(), and ScaffoldController::update().

Here is the caller graph for this function:

render ( action,
layout = false 
)

render the given view with the given layout and put the result in the output-property of this controller. this just calls renderView which does the real work.

Parameters:
string $action name of the view (without .php) to render
string $layout optional: name of the layout(-view) to render the view into. if false the default layout of this controller is taken

Definition at line 206 of file controller.php.

References $action, $layout, and renderView().

Referenced by ScaffoldController::index(), ScaffoldController::insert(), and ScaffoldController::update().

Here is the call graph for this function:

Here is the caller graph for this function:

& renderCachedHtml ( html,
layout = null 
)

render the given view with the given layout and put the result in the output-property of this controller.

Parameters:
string $html raw html
string $layout optional: name of the layout(-view) to render the view into. if false the default layout of this controller is taken

Definition at line 245 of file controller.php.

References $layout, and initViewClass().

Here is the call graph for this function:

& renderView ( action,
layout = null 
)

render the given view with the given layout and put the result in the output-property of this controller.

Parameters:
string $action name of the view (without .php) to render
string $layout optional: name of the layout(-view) to render the view into. if false the default layout of this controller is taken

Definition at line 226 of file controller.php.

References $action, $layout, afterFilter(), beforeFilter(), and initViewClass().

Referenced by render().

Here is the call graph for this function:

Here is the caller graph for this function:

set ( name,
value = null 
)

set a variable to be available inside the view. the given name-string is the name of the global variable inside the view ('bla' => $bla)

Parameters:
string $name name of the variable that should be globally accessible inside the view
mixed $value contents of the variable

Definition at line 305 of file controller.php.

References setPageTitle().

Here is the call graph for this function:

setPageTitle ( n  ) 

set the pagetitle for the current layout

Parameters:
string $n title

Definition at line 296 of file controller.php.

Referenced by set(), and setRef().

Here is the caller graph for this function:

setRef ( name,
&$  value 
)

like set, but assignes the variable by reference (faster)

Parameters:
string $name name of the variable that should be globally accessible inside the view
mixed $value contents of the variable

Definition at line 318 of file controller.php.

References setPageTitle().

Here is the call graph for this function:


Field Documentation

$action

Definition at line 80 of file controller.php.

Referenced by render(), and renderView().

$autoRender = true

Definition at line 57 of file controller.php.

$base

Definition at line 98 of file controller.php.

$basePath

Definition at line 92 of file controller.php.

$cache = null

Definition at line 46 of file controller.php.

$components = array()

Definition at line 38 of file controller.php.

$helpers = array('html')

Definition at line 32 of file controller.php.

$layout = 'default'

which layout to use. null means an empty layout, otherwise kata will look for views/layouts/default.thtml

Definition at line 51 of file controller.php.

Referenced by render(), renderCachedHtml(), and renderView().

$output = ''

Definition at line 68 of file controller.php.

$pageTitle = ''

string with a pagetitle to render to the current layout ($title_for_layout inside the view)

Definition at line 103 of file controller.php.

$params = null

holds params (get,post,controller,action) of this request

Definition at line 62 of file controller.php.

$uses = array()

Definition at line 26 of file controller.php.

Referenced by __construct().

$view = 'View'

Definition at line 109 of file controller.php.

$viewClass = null [protected]

Definition at line 115 of file controller.php.

$viewVars = array()

Definition at line 74 of file controller.php.

$webroot

Definition at line 86 of file controller.php.


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

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