Skip to content

Commit e9aa0b8

Browse files
authored
Merge pull request #8082 from cakephp/5.3-nested-input
Add info for cakephp/cakephp#18865
2 parents 487c0e8 + f99ec6b commit e9aa0b8

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

en/appendices/5-3-migration-guide.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,8 @@ View
163163
wrapping script tags (``<script>...</script>``) around inline JavaScript. This
164164
enables syntax highlighting in many editors to work. The wrapping script tag
165165
will be removed and replaced with a script tag generated by the helper.
166+
167+
- :php:class:`FormHelper` now supports a new option ``nestedCheckboxAndRadio``.
168+
By default, the helper generates inputs of type checkbox and radio nested
169+
inside their label. Setting the ``nestedCheckboxAndRadio`` option to ``false``
170+
will turn off the nesting.

en/views/helpers/form.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,12 @@ as well as HTML attributes. This subsection will cover the options specific to
678678

679679
On the other hand you can set this to ``true`` for any control type to force the
680680
generated input element inside the label. If you change this for radio buttons
681-
then you need to also modify the default
682-
:ref:`radioWrapper<create-radio-button>` template. Depending on the generated
683-
control type it defaults to ``true`` or ``false``.
681+
then you might want to also modify the default :ref:`radioWrapper<create-radio-button>`
682+
template to add a wrapping ``div``. Depending on the generated control type it
683+
defaults to ``true`` or ``false``.
684+
685+
If you want to disable the nesting of checkbox and radio inputs globally you can
686+
set ``nestedCheckboxAndRadio`` option of ``FormHelper`` to ``false``.
684687

685688
* ``$options['templates']`` - The templates you want to use for this input. Any
686689
specified templates will be merged on top of the already loaded templates.

0 commit comments

Comments
 (0)