diff --git a/composer.json b/composer.json index 3f176b01f8f4..4a4850eef832 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "phpunit/phpcov": "^8.2", "phpunit/phpunit": "^9.1", "predis/predis": "^1.1 || ^2.0", - "rector/rector": "0.15.23", + "rector/rector": "0.15.24", "vimeo/psalm": "^5.0" }, "suggest": { diff --git a/contributing/documentation.rst b/contributing/documentation.rst index fdffa1611a98..887ed2d8343e 100644 --- a/contributing/documentation.rst +++ b/contributing/documentation.rst @@ -3,17 +3,12 @@ Writing CodeIgniter Documentation ################################# CodeIgniter uses Sphinx to generate its documentation in a variety of formats, -using reStructuredText to handle the formatting. If you are familiar with +using `reStructuredText`_ to handle the formatting. If you are familiar with Markdown or Textile, you will quickly grasp reStructuredText. The focus is on readability and user friendliness. While they can be quite technical, we always write for humans! -A local table of contents should always be included, like the one below. -It is created automatically by inserting the following:: - - .. contents:: - :local: - :depth: 2 +.. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html .. contents:: :local: @@ -26,7 +21,18 @@ To see the rendered HTML, ePub, PDF, etc., you will need to install Sphinx along with the PHP domain extension for Sphinx. The underlying requirement is to have Python installed. -You can read more about installing all tools in /user_guide_src/README.rst +You can read more about installing all tools in **user_guide_src/README.rst** + +***************** +Table of Contents +***************** + +A local table of contents should always be included, like the one below. +It is created automatically by inserting the following:: + + .. contents:: + :local: + :depth: 2 ***************************************** Page and Section Headings and Subheadings @@ -119,15 +125,21 @@ You can reference a page like the following:: To a URL ======== +:: + `CodeIgniter 4 framework `_ To a Function ============= +:: + :php:func:`dot_array_search()` To a Method -============= +=========== + +:: :php:meth:`CodeIgniter\\HTTP\\Response::setCookie()` @@ -138,10 +150,24 @@ Other Directives New Feature =========== +:: + .. versionadded:: 4.3.0 Deprecated ========== +:: + .. deprecated:: 4.3.0 Use :php:meth:`CodeIgniter\\Database\\BaseBuilder::setData()` instead. + +*************** +Text Decoration +*************** + +As a general rule, we use ``**`` for in-line file paths, and `````` for source code. + +E.g.:: + + Open the **app/Config/Filters.php** file and update the ``$methods`` property like the following: diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index 7d30aac845fd..ae645d26c1a9 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -62,7 +62,10 @@ Application Structure Routing ======= -- The Auto Routing is disabled by default. If you want to use the Auto Routing in the same way as CI3, you need to enable :ref:`auto-routing-legacy`. +- The Auto Routing is disabled by default. You need to :ref:`define all routes + ` by default. +- If you want to use the Auto Routing in the same way as CI3, you need to enable + :ref:`auto-routing-legacy`. - CI4 also has an optional new more secure :ref:`auto-routing-improved`. Model, View and Controller @@ -204,6 +207,3 @@ Upgrading Libraries upgrade_sessions upgrade_validations upgrade_view_parser - -.. note:: - More upgrade guides coming soon diff --git a/user_guide_src/source/installation/upgrade_validations.rst b/user_guide_src/source/installation/upgrade_validations.rst index b7d89671b610..acc093a94580 100644 --- a/user_guide_src/source/installation/upgrade_validations.rst +++ b/user_guide_src/source/installation/upgrade_validations.rst @@ -15,6 +15,9 @@ What has been changed ===================== - If you want to change validation error display, you have to set CI4 :ref:`validation View templates `. - CI4 validation has no Callbacks nor Callable in CI3. + Use :ref:`Rule Classes ` or + :ref:`Closure Rule ` + instead. - CI4 validation format rules do not permit empty string. - CI4 validation never changes your data. - Since v4.3.0, :php:func:`validation_errors()` has been introduced, but the API is different from CI3's. diff --git a/user_guide_src/source/libraries/security.rst b/user_guide_src/source/libraries/security.rst index 970e5be45c41..bc5777f759fa 100644 --- a/user_guide_src/source/libraries/security.rst +++ b/user_guide_src/source/libraries/security.rst @@ -121,6 +121,9 @@ Redirection on Failure Since v4.3.0, when a request fails the CSRF validation check, it will throw a SecurityException by default, +.. note:: In production environment, when you use HTML forms, it is recommended + to enable this redirection for a better user experience. + If you want to make it redirect to the previous page, change the following config parameter value in **app/Config/Security.php**: diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index fc0b93709e47..823a8b899bb3 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -612,6 +612,8 @@ right after the name of the field the error should belong to:: Creating Custom Rules ********************* +.. _validation-using-rule-classes: + Using Rule Classes ==================