Skip to content

Commit 47551ae

Browse files
authored
Merge pull request #8199 from kenjis/docs-controller-returns-response
docs: add about Controller returns string/Response
2 parents 93c0b7b + 0cdd299 commit 47551ae

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

user_guide_src/source/incoming/controllers.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ Controllers are the heart of your application, as they determine how HTTP reques
1111
What is a Controller?
1212
*********************
1313

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

1618
Every controller you create should extend ``BaseController`` class.
1719
This class provides several features that are available to all of your controllers.

user_guide_src/source/installation/upgrade_controllers.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ What has been changed
2020
- CI4 provides :doc:`Request </incoming/incomingrequest>` and :doc:`Responses </outgoing/response>`
2121
objects for you to work with - more powerful than the CI3-way.
2222
- If you want a base controller (``MY_Controller`` in CI3), use **app/Controllers/BaseController.php**.
23+
- Calling ``echo`` within Controllers, as in CI3, is still supported, but
24+
it is recommended that a string or Response object be returned from Controllers.
2325

2426
Upgrade Guide
2527
=============

0 commit comments

Comments
 (0)