class RestrictedController extends Controller

Implements support for the Restricted controller. Interactions that the user performs that are restricted will result in a relevant view being rendered.

Properties

protected string $_action

The name of the current action.

from  Controller
protected string $_controller

The name of the current controller.

from  Controller
Input $request

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

from  Controller
View $view

Instance of view class.

from  Controller

Methods

__construct(string $controller, string $action)

Calls functions for reporting and unregister of globals.

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()

Runs when the object is constructed.

void
badTokenAction()

Renders page when a bad csrf token is detected.

void
indexAction()

This controller's default action.

void
noControllerAction(string $controllerName)

Handles case when controller is not found and sets 404 response.

void
notFoundAction(string $actionName, string $controllerName)

Handles cases when view is not found and sets 404 response.

Details

in Controller 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 23
private void _set_reporting()

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

Return Value

void

in Controller 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 66
void onConstruct()

Runs when the object is constructed.

Return Value

void

at line 17
void badTokenAction()

Renders page when a bad csrf token is detected.

Return Value

void

at line 27
void indexAction()

This controller's default action.

Return Value

void

at line 37
void noControllerAction(string $controllerName)

Handles case when controller is not found and sets 404 response.

Parameters

string $controllerName

The name of the controller.

Return Value

void

at line 52
void notFoundAction(string $actionName, string $controllerName)

Handles cases when view is not found and sets 404 response.

Parameters

string $actionName

The name of the action/view.

string $controllerName

The name of the controller.

Return Value

void