RestrictedController
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
Constructor for the parent Controller class. This constructor gets called when an instance of the child class is instantiated.
Initializes ErrorHandler and SessionManager and starts execution of the app.
Manages the displaying of error messages and other reporting for this application.
Captures the current View instance during testing so that test assertions (e.g., assertViewContains) can access view-bound variables.
Function implemented by child model classes when models are instantiated.
Renders page when a bad csrf token is detected.
This controller's default action.
Handles case when controller is not found and sets 404 response.
Handles cases when view is not found and sets 404 response.
Details
in
Controller at line 47
__construct(string $controller, string $action)
Constructor for the parent Controller class. This constructor gets called when an instance of the child class is instantiated.
in
Application at line 26
static void
appStart()
Initializes ErrorHandler and SessionManager and starts execution of the app.
in
Application at line 51
private void
_set_reporting()
Manages the displaying of error messages and other reporting for this application.
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.
at line 66
void
onConstruct()
Function implemented by child model classes when models are instantiated.
at line 17
void
badTokenAction()
Renders page when a bad csrf token is detected.
at line 27
void
indexAction()
This controller's default action.
at line 37
void
noControllerAction(string $controllerName)
Handles case when controller is not found and sets 404 response.
at line 52
void
notFoundAction(string $actionName, string $controllerName)
Handles cases when view is not found and sets 404 response.