Properties

$components

$components : array

Required components

Type

array

$models

$models : array

Required models

Type

array

$seminary

$seminary : 

Current Seminary

var array

Type

$character

$character : array

Character of current user and Seminary

Type

array

$user

$user : array

Current user

Type

array

$permissions

$permissions : array

User permissions

Type

array

$seminaryPermissions

$seminaryPermissions : array

User seminary permissions

Type

array

$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

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

getTitle()

getTitle() : string

Return current title information.

Returns

string —

Title information

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

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

seminary()

seminary(string  $seminaryUrl, string  $uploadUrl, string  $action = null) 

Action: seminary.

Display a Seminary upload.

Parameters

string $seminaryUrl

URL-title of Seminary

string $uploadUrl

URL-name of the upload

string $action

Current action (optional)

Throws

\nre\exceptions\AccessDeniedException
\nre\exceptions\IdNotFoundException

charactergroup()

charactergroup(string  $seminaryUrl, string  $groupsgroupUrl, string  $groupUrl) 

Action: charactergroup.

Display the icon of a Character group.

Parameters

string $seminaryUrl

URL-Title of a Seminary

string $groupsgroupUrl

URL-Title of a Character groups-group

string $groupUrl

URL-Title of a Character group

Throws

\nre\exceptions\IdNotFoundException

__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

checkAchievements()

checkAchievements(\nre\core\Request  $request, \nre\core\Response  $response, array  $checkConditions = null) 

Check for newly achieved Achievements.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

array $checkConditions

Conditions to check

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

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\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

checkPermission()

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

Check user permissions.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

Throws

\nre\exceptions\AccessDeniedException

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

getUploadFile()

getUploadFile(array  $upload) : object

Determine the file for an upload.

Parameters

array $upload

Upload to get file for

Throws

\nre\exceptions\IdNotFoundException

Returns

object —

File for the upload (or null if upload is cached)

createThumbnail()

createThumbnail(array  $upload) : object

Create a thumbnail from an upload.

Parameters

array $upload

Upload to create thumbnail for

Returns

object —

Thumbnail for the upload (or null if thumbnail is cached)

setCacheHeaders()

setCacheHeaders(string  $fileName) : boolean

Determine file information and set the HTTP-header for caching accordingly.

Parameters

string $fileName

Filename

Returns

boolean —

HTTP-status 304 was set (in cache)