From f99ec6b06210d469b5d7d94597ea303762e6d2d3 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sun, 7 Sep 2025 12:20:27 +0530 Subject: [PATCH] Add info for cakephp/cakephp#18865 --- en/appendices/5-3-migration-guide.rst | 5 +++++ en/views/helpers/form.rst | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/en/appendices/5-3-migration-guide.rst b/en/appendices/5-3-migration-guide.rst index 06e4d92690..fd278d895b 100644 --- a/en/appendices/5-3-migration-guide.rst +++ b/en/appendices/5-3-migration-guide.rst @@ -154,3 +154,8 @@ View wrapping script tags (````) around inline JavaScript. This enables syntax highlighting in many editors to work. The wrapping script tag will be removed and replaced with a script tag generated by the helper. + +- :php:class:`FormHelper` now supports a new option ``nestedCheckboxAndRadio``. + By default, the helper generates inputs of type checkbox and radio nested + inside their label. Setting the ``nestedCheckboxAndRadio`` option to ``false`` + will turn off the nesting. diff --git a/en/views/helpers/form.rst b/en/views/helpers/form.rst index d180f8e250..d63d3edc8c 100644 --- a/en/views/helpers/form.rst +++ b/en/views/helpers/form.rst @@ -678,9 +678,12 @@ as well as HTML attributes. This subsection will cover the options specific to On the other hand you can set this to ``true`` for any control type to force the generated input element inside the label. If you change this for radio buttons - then you need to also modify the default - :ref:`radioWrapper` template. Depending on the generated - control type it defaults to ``true`` or ``false``. + then you might want to also modify the default :ref:`radioWrapper` + template to add a wrapping ``div``. Depending on the generated control type it + defaults to ``true`` or ``false``. + + If you want to disable the nesting of checkbox and radio inputs globally you can + set ``nestedCheckboxAndRadio`` option of ``FormHelper`` to ``false``. * ``$options['templates']`` - The templates you want to use for this input. Any specified templates will be merged on top of the already loaded templates.