Skip to content

Commit

Permalink
docs: replace Traditional with Legacy for auto-routing
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Apr 28, 2022
1 parent 36d4c86 commit f495513
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion user_guide_src/source/changelogs/v4.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Enhancements
New Improved Auto Routing
=========================

Added an optional new more secure auto router. These are the changes from the traditional auto-routing:
Added an optional new more secure auto router. These are the changes from the legacy auto-routing:

- A controller method needs HTTP verb prefix like ``getIndex()``, ``postCreate()``.
- Developers always know the HTTP method, so requests by an unexpected HTTP method does not pass.
Expand Down
10 changes: 5 additions & 5 deletions user_guide_src/source/incoming/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,18 +278,18 @@ CodeIgniter also permits you to map your URIs using its :ref:`Defined Route Rout

.. _controller-auto-routing:

Auto Routing (Traditional)
**************************
Auto Routing (Legacy)
*********************

This section describes the functionality of Auto Routing (Traditional) that is a routing system from CodeIgniter 3.
This section describes the functionality of Auto Routing (Legacy) that is a routing system from CodeIgniter 3.
It automatically routes an HTTP request, and executes the corresponding controller method
without route definitions. The auto-routing is disabled by default.

.. warning:: To prevent misconfiguration and miscoding, we recommend that you do not use
Auto Routing (Traditional). It is easy to create vulnerable apps where controller filters
Auto Routing (Legacy). It is easy to create vulnerable apps where controller filters
or CSRF protection are bypassed.

.. important:: Auto Routing (Traditional) routes a HTTP request with **any** HTTP method to a controller method.
.. important:: Auto Routing (Legacy) routes a HTTP request with **any** HTTP method to a controller method.

Consider this URI::

Expand Down
32 changes: 16 additions & 16 deletions user_guide_src/source/incoming/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -610,32 +610,32 @@ In this example, if the user were to visit **example.com/products**, and a ``Pro

.. _auto-routing:

Auto Routing (Traditional)
**************************
Auto Routing (Legacy)
*********************

Auto Routing (Traditional) is a routing system from CodeIgniter 3.
Auto Routing (Legacy) is a routing system from CodeIgniter 3.
It can automatically route HTTP requests based on conventions and execute the corresponding controller methods.

It is recommended that all routes are defined in the **app/Config/Routes.php** file,
or to use :ref:`auto-routing-improved`,

.. warning:: To prevent misconfiguration and miscoding, we recommend that you do not use
Auto Routing (Traditional) feature. It is easy to create vulnerable apps where controller filters
Auto Routing (Legacy) feature. It is easy to create vulnerable apps where controller filters
or CSRF protection are bypassed.

.. important:: Auto Routing (Traditional) routes a HTTP request with **any** HTTP method to a controller method.
.. important:: Auto Routing (Legacy) routes a HTTP request with **any** HTTP method to a controller method.

Enable Auto Routing (Traditional)
=================================
Enable Auto Routing (Legacy)
============================

Since v4.2.0, the auto-routing is disabled by default.

To use it, you need to change the setting ``setAutoRoute()`` option to true in **app/Config/Routes.php**::

$routes->setAutoRoute(true);

URI Segments (Traditional)
==========================
URI Segments (Legacy)
=====================

The segments in the URL, in following with the Model-View-Controller approach, usually represent::

Expand All @@ -652,15 +652,15 @@ Consider this URI::
In the above example, CodeIgniter would attempt to find a controller named **Helloworld.php**
and executes ``index()`` method with passing ``'1'`` as the first argument.

See :ref:`Auto Routing (Traditional) in Controllers <controller-auto-routing>` for more info.
See :ref:`Auto Routing (Legacy) in Controllers <controller-auto-routing>` for more info.

Configuration Options (Traditional)
===================================
Configuration Options (Legacy)
==============================

These options are available at the top of **app/Config/Routes.php**.

Default Controller (Traditional)
--------------------------------
Default Controller (Legacy)
---------------------------

When a user visits the root of your site (i.e., example.com) the controller to use is determined by the value set by
the ``setDefaultController()`` method, unless a route exists for it explicitly. The default value for this is ``Home``
Expand All @@ -674,8 +674,8 @@ in the controllers directory. For example, if the user visits **example.com/admi

See :ref:`Auto Routing in Controllers <controller-auto-routing>` for more info.

Default Method (Traditional)
----------------------------
Default Method (Legacy)
-----------------------

This works similar to the default controller setting, but is used to determine the default method that is used
when a controller is found that matches the URI, but no segment exists for the method. The default value is
Expand Down

0 comments on commit f495513

Please sign in to comment.