Controller (class)
Class Controller
Application controller class for organization of business logic. Provides basic functionality, such as rendering views inside layouts, automatic model availability, redirection, callbacks, and more.
Controllers should provide a number of 'action' methods. These are public methods on a controller that are not inherited from Controller
. Each action serves as an endpoint for performing a specific action on a resource or collection of resources. For example adding or editing a new object, or listing a set of objects.
You can access request parameters, using $this->request
. The request object contains all the POST, GET and FILES that were part of the request.
After performing the required action, controllers are responsible for creating a response. This usually takes the form of a generated View
, or possibly a redirection to another URL. In either case $this->response