You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform and Target: Ubuntu 18, Nginx 1.14, MariaDB 10.1
What you did
I have added custom form controls in src/Plugins/Name/config/form-controls.php
Which states: 'input' => '<input type="{{type}}" name="{{name}}" class="form-control" {{attrs}} />',
I have told cake to use this plugin by setting this in my AppView: $this->loadHelper('Form', ['templates' => 'Name.form-controls']);
I have told the add.ctp to include a class attribute src/Template/Users/add.ctp <?php echo $this->Form->text('first_name',['required', 'class' => 'large']); ?>
What happened
The resulting HTML is rendered as: <input type="text" name="last_name" class="form-control" required="required">
What you expected to happen
The expected HTML should be: <input type="text" name="last_name" class="form-control large" required="required">
Previous versions did merge the attributes. Since 3.8 it ignores and additional classes added in the template files.
The text was updated successfully, but these errors were encountered:
Your class attribute in your template has no placeholders for class name. The string templates are simple and don't parse the template string to manipulate classnames.
In which previous version did your template generate the html you are expecting?
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
CakePHP Version: 3.8.1
Platform and Target: Ubuntu 18, Nginx 1.14, MariaDB 10.1
What you did
I have added custom form controls in src/Plugins/Name/config/form-controls.php
Which states:
'input' => '<input type="{{type}}" name="{{name}}" class="form-control" {{attrs}} />',
I have told cake to use this plugin by setting this in my AppView:
$this->loadHelper('Form', ['templates' => 'Name.form-controls']);
I have told the add.ctp to include a class attribute src/Template/Users/add.ctp
<?php echo $this->Form->text('first_name',['required', 'class' => 'large']); ?>
What happened
The resulting HTML is rendered as:
<input type="text" name="last_name" class="form-control" required="required">
What you expected to happen
The expected HTML should be:
<input type="text" name="last_name" class="form-control large" required="required">
Previous versions did merge the attributes. Since 3.8 it ignores and additional classes added in the template files.
The text was updated successfully, but these errors were encountered: