Properties

$view

$view : \nre\core\View

View of the Controller

Type

\nre\core\View

$viewData

$viewData : array

Data to pass to the View

Type

array

Methods

load()

load(string  $controllerName) 

Load the class of a Controller.

Parameters

string $controllerName

Name of the Controller to load

Throws

\nre\exceptions\ControllerNotFoundException
\nre\exceptions\ControllerNotValidException

factory()

factory(string  $controllerName, string  $layoutName, string  $action, string  $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

string $agent

Corresponding Agent

Throws

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

preFilter()

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

Prefilter.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

postFilter()

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

Prefilter that is executed after running the Controller.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

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\exceptions\ParamsNotValidException
\nre\exceptions\IdNotFoundException
\nre\exceptions\DatamodelException
\nre\exceptions\ActionNotFoundException

render()

render(array  $viewData = null) : string

Generate the output.

Parameters

array $viewData

Data to pass to the View

Returns

string —

Generated output

userregistration()

userregistration(array  $receiver,   $newUser) 

Action: userregistration.

Generate a mail message to notify of a new user registration.

Parameters

array $receiver

User that the message will be send to

$newUser

characterregistration()

characterregistration(array  $receiver, array  $seminary, \hhu\z\controllers\arary  $user, array  $newCharacter) 

Action: characterregistration.

Generate a mail message to notify of a new Character registration.

Parameters

array $receiver

User that the message will be send to

array $seminary

Seminary which the Character was created for

\hhu\z\controllers\arary $user

User of the newly registered Character

array $newCharacter

Newly registered Character

charactersubmission()

charactersubmission(array  $receiver, array  $seminary, array  $questgroup, array  $quest, array  $character) 

Action: charactersubmission.

Generate a mail message to notify of a new Character submission for a Quest that needs to be valuated.

Parameters

array $receiver

User that the message will be send to

array $seminary

Seminary which the Quest belongs to

array $questgroup

Questgroup of Quest

array $quest

Quest the answer has been submitted for

array $character

Character that send the submission

charactersubmissionapproved()

charactersubmissionapproved(array  $receiver, array  $seminary, array  $questgroup, array  $quest) 

Action: charactersubmissionapproved.

Generate a mail message to notify a Character that its submission has been approved.

Parameters

array $receiver

User that the message will be send to

array $seminary

Seminary which the Quest belongs to

array $questgroup

Questgroup of Quest

array $quest

Quest the answer has been submitted for

__construct()

__construct(string  $layoutName, string  $action, \nre\core\Agent  $agent) 

Construct a new Controller.

Parameters

string $layoutName

Name of the current Layout

string $action

Current Action

\nre\core\Agent $agent

Corresponding Agent

Throws

\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException
\nre\exceptions\ViewNotFoundException

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\exceptions\DatamodelException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\DriverNotValidException
\nre\exceptions\ModelNotValidException
\nre\exceptions\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\exceptions\ViewNotFoundException

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\exceptions\ComponentNotValidException
\nre\exceptions\ComponentNotFoundException