Skip to content

Commit

Permalink
Document changes in cakephp/cakephp#18158
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 28, 2025
1 parent 8275518 commit 834090d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions en/appendices/5-2-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ View
templates using ``DELETE`` method.
- ``HtmlHelper::importmap()`` was added. This method allows you to define
import maps for your JavaScript files.
- ``FormHelper`` now uses the ``containerClass`` template to apply a class to
the form control div. The default value is ``input``.

Error
-----
Expand Down
5 changes: 3 additions & 2 deletions en/views/helpers/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,14 @@ methods of FormHelper.

By default the ``control()`` method will employ the following widget templates::

'inputContainer' => '<div class="input {{type}}{{required}}">{{content}}</div>'
'inputContainer' => '<div class="{{constainerClass}} {{type}}{{required}}">{{content}}</div>'
'input' => '<input type="{{type}}" name="{{name}}"{{attrs}}>'
'requiredClass' => 'required'
'containerClass' => 'input'

In case of validation errors it will also use::

'inputContainerError' => '<div class="input {{type}}{{required}} error">{{content}}{{error}}</div>'
'inputContainerError' => '<div class="{{containerClass}} {{type}}{{required}} error">{{content}}{{error}}</div>'

The type of control created (when we provide no additional options to specify the
generated element type) is inferred via model introspection and
Expand Down

0 comments on commit 834090d

Please sign in to comment.