Controller
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
Constructor for the parent Controller class. This constructor gets called when an instance of the child class is instantiated.
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.
Details
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.
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 79
void
onConstruct()
Function implemented by child model classes when models are instantiated.