Skip to content

Commit 6907ce6

Browse files
committed
docs: update explanation for private methods
1 parent 9204889 commit 6907ce6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

user_guide_src/source/incoming/controllers.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,22 @@ The method accepts an array of data to validate in the first parameter:
9595

9696
.. literalinclude:: controllers/006.php
9797

98-
Private methods
99-
***************
98+
Protecting Methods
99+
******************
100100

101101
In some cases, you may want certain methods hidden from public access.
102102
To achieve this, simply declare the method as ``private`` or ``protected``.
103-
That will prevent it from being served by a URL request. For example,
104-
if you were to define a method like this for the ``Helloworld`` controller:
103+
That will prevent it from being served by a URL request.
104+
105+
For example, if you were to define a method like this for the ``Helloworld`` controller:
105106

106107
.. literalinclude:: controllers/007.php
107108

108-
then trying to access it using the following URL will not work::
109+
and to define a route (``helloworld/utitilty``) for the method. Then trying to access it using the following URL will not work::
110+
111+
example.com/index.php/helloworld/utility
109112

110-
example.com/index.php/helloworld/utility/
113+
Auto-routing also will not work.
111114

112115
.. _controller-auto-routing-improved:
113116

0 commit comments

Comments
 (0)