class Controller extends Application

This is the parent Controller class. It describes functions that are available to all classes that extends this Controller class.

Properties

protected string $_action

The name of the current action.

protected string $_controller

The name of the current controller.

Input $request

Instance of Input class that performs much of our request tasks.

View $view

Instance of view class.

Methods

__construct(string $controller, string $action)

Calls functions for reporting and unregister of globals.

static void
appStart()

Initializes ErrorHandler and SessionManager and starts execution of the app.

void
_set_reporting()

Manages the displaying of error messages and other reporting for this application.

void
logViewForTesting(View $view)

Captures the current View instance during testing so that test assertions (e.g., assertViewContains) can access view-bound variables.

void
onConstruct()

Function implemented by child model classes when models are instantiated.

Details

at line 47
__construct(string $controller, string $action)

Calls functions for reporting and unregister of globals.

Parameters

string $controller

The name of the controller obtained while parsing the URL.

string $action

The name of the action specified in the path of the URL.

in Application at line 26
static void appStart()

Initializes ErrorHandler and SessionManager and starts execution of the app.

Return Value

void

in Application at line 51
private void _set_reporting()

Manages the displaying of error messages and other reporting for this application.

Return Value

void

at line 67
protected void logViewForTesting(View $view)

Captures the current View instance during testing so that test assertions (e.g., assertViewContains) can access view-bound variables.

This method should be called in controller actions before rendering a view. It stores the View object in ApplicationTestCase::$controllerOutput['view'] when the application is running in the 'testing' environment.

Parameters

View $view

The View instance to capture.

Return Value

void

at line 79
void onConstruct()

Function implemented by child model classes when models are instantiated.

Return Value

void