File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ A Controller is simply a class file that handles a HTTP request. :doc:`URI Routi
1616Every controller you create should extend ``BaseController `` class.
1717This class provides several features that are available to all of your controllers.
1818
19+ .. _controller-constructor :
20+
1921Constructor
2022***********
2123
Original file line number Diff line number Diff line change @@ -15,10 +15,11 @@ What has been changed
1515=====================
1616
1717- Since namespaces have been added to CodeIgniter 4, the controllers must be changed to support namespaces.
18- - Controllers don't use constructors any more (to invoke CI 'magic') unless those are part of base controllers you make.
19- - CI4 provides Request and Response objects for you to work with - more powerful than the CI3-way.
20- - If you want a base controller (``MY_Controller `` in CI3), make it where you like,
21- e.g., BaseController extends Controller, and then have your controllers extend it
18+ - The constructor of CI4 Controller does not automatically load core classes into the properties.
19+ - CI4's Controller has a special constructor :ref: `initController() <controller-constructor >`.
20+ - CI4 provides :doc: `Request </incoming/incomingrequest >` and :doc: `Responses </outgoing/response >`
21+ objects for you to work with - more powerful than the CI3-way.
22+ - If you want a base controller (``MY_Controller `` in CI3), use **app/Controllers/BaseController.php **.
2223
2324Upgrade Guide
2425=============
You can’t perform that action at this time.
0 commit comments