Skip to content

Commit

Permalink
Merge pull request #8199 from kenjis/docs-controller-returns-response
Browse files Browse the repository at this point in the history
docs: add about Controller returns string/Response
  • Loading branch information
kenjis authored Nov 14, 2023
2 parents 93c0b7b + 0cdd299 commit 47551ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion user_guide_src/source/incoming/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Controllers are the heart of your application, as they determine how HTTP reques
What is a Controller?
*********************

A Controller is simply a class file that handles a HTTP request. :doc:`URI Routing <routing>` associates a URI with a controller.
A Controller is simply a class file that handles a HTTP request.
:doc:`URI Routing <routing>` associates a URI with a controller. It returns a
view string or ``Response`` object.

Every controller you create should extend ``BaseController`` class.
This class provides several features that are available to all of your controllers.
Expand Down
2 changes: 2 additions & 0 deletions user_guide_src/source/installation/upgrade_controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ What has been changed
- CI4 provides :doc:`Request </incoming/incomingrequest>` and :doc:`Responses </outgoing/response>`
objects for you to work with - more powerful than the CI3-way.
- If you want a base controller (``MY_Controller`` in CI3), use **app/Controllers/BaseController.php**.
- Calling ``echo`` within Controllers, as in CI3, is still supported, but
it is recommended that a string or Response object be returned from Controllers.

Upgrade Guide
=============
Expand Down

0 comments on commit 47551ae

Please sign in to comment.