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 the controller that are not prefixed with a '_' and not part of 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 actions, controllers are responsible for creating a response. This usually takes the form of a generated View, or possibly a redirection to another controller action. In either case $this->res