Properties

$components

$components : array

Required components

Type

array

$models

$models : array

Required models

Type

array

$user

$user : array

Current user

Type

array

$log

$log : \hhu\z\Logger

Logger instance

Type

\hhu\z\Logger

$linker

$linker : \hhu\z\Linker

Linker instance

Type

\hhu\z\Linker

$view

$view : \nre\core\View

View of the Controller

Type

\nre\core\View

$viewData

$viewData : array

Data to pass to the View

Type

array

$title

$title : array

Title information

Type

array

Methods

__construct()

__construct(string  $layoutName, string  $action, \hhu\z\controllers\Agent  $agent) 

Construct a new IntermediateController.

Parameters

string $layoutName

Name of the current Layout

string $action

Current Action

\hhu\z\controllers\Agent $agent

Corresponding Agent

Throws

\hhu\z\controllers\DriverNotFoundException
\hhu\z\controllers\DriverNotValidException
\hhu\z\controllers\ModelNotValidException
\hhu\z\controllers\ModelNotFoundException
\hhu\z\controllers\ViewNotFoundException

preFilter()

preFilter(\hhu\z\controllers\Request  $request, \hhu\z\controllers\Response  $response) 

Prefilter that is executed before running the Controller.

Parameters

\hhu\z\controllers\Request $request

Current request

\hhu\z\controllers\Response $response

Current response

postFilter()

postFilter(\hhu\z\controllers\Request  $request, \hhu\z\controllers\Response  $response) 

Postfilter that is executed after running the Controller.

Parameters

\hhu\z\controllers\Request $request

Current request

\hhu\z\controllers\Response $response

Current response

load()

load(string  $controllerName) 

Load the class of a Controller.

Parameters

string $controllerName

Name of the Controller to load

Throws

\nre\core\ControllerNotFoundException
\nre\core\ControllerNotValidException

factory()

factory(string  $controllerName, string  $layoutName, string  $action,   $agent) 

Instantiate a Controller (Factory Pattern).

Parameters

string $controllerName

Name of the Controller to instantiate

string $layoutName

Name of the current Layout

string $action

Current Action

$agent

Throws

\nre\core\DatamodelException
\nre\core\DriverNotFoundException
\nre\core\DriverNotValidException
\nre\core\ModelNotValidException
\nre\core\ModelNotFoundException
\nre\core\ViewNotFoundException

run()

run(\nre\core\Request  $request, \nre\core\Response  $response) 

Run the Controller.

This method executes the Action of the Controller defined by the current Request.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

Throws

\nre\core\ParamsNotValidException
\nre\core\IdNotFoundException
\nre\core\DatamodelException
\nre\core\ActionNotFoundException

render()

render(array  $viewData = null) : string

Generate the output.

Parameters

array $viewData

Data to pass to the View

Returns

string —

Generated output

getTitle()

getTitle() : string

Return current title information.

Returns

string —

Title information

log()

log(string  $message, integer  $logMode = \nre\core\Logger::LOGMODE_AUTO) 

Log an error.

Parameters

string $message

Error message to log

integer $logMode

Log mode (optional)

set()

set(string  $name, mixed  $data) 

Set data for the View.

Parameters

string $name

Key

mixed $data

Value

redirect()

redirect(string  $url) 

Redirect to the given URL.

Parameters

string $url

Relative URL

checkModels()

checkModels(string  $modelName) : boolean

Check if Models of this Controller are loaded and available.

Parameters

string $modelName

Arbitrary number of Models to check

Returns

boolean —

All given Models are loaded and available

getView()

getView() : \nre\core\View

Get the View of the Controller

Returns

\nre\core\View

View of the Controller

loadModels()

loadModels() 

Load the Models of this Controller.

Throws

\nre\core\DatamodelException
\nre\core\DriverNotFoundException
\nre\core\DriverNotValidException
\nre\core\ModelNotValidException
\nre\core\ModelNotFoundException

loadView()

loadView(string  $layoutName, string  $action) 

Load the View of this Controller.

Parameters

string $layoutName

Name of the current Layout

string $action

Current Action

Throws

\nre\core\ViewNotFoundException

addTitle()

addTitle(string  $title) 

Add a piece of information to the current title.

Parameters

string $title

Title information

addTitleLocalized()

addTitleLocalized(string  $title) 

Add a piece of information to the current title and localize it.

Parameters

string $title

Title information

getClassName()

getClassName(string  $controllerName) : string

Determine the classname for the given Controller name.

Parameters

string $controllerName

Controller name to get classname of

Returns

string —

Classname for the Controller name

loadComponents()

loadComponents() 

Load the Components of this Controller.

Throws

\nre\core\ComponentNotValidException
\nre\core\ComponentNotFoundException

checkPermission()

checkPermission(\nre\core\Request  $request, \nre\core\Response  $response) 

Check user permissions.

Parameters

\nre\core\Request $request
\nre\core\Response $response

Throws

\hhu\z\controllers\AccessDeniedException