Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #26332 Add a data_help method in Form (mpiot, Nyholm)
This PR was merged into the 4.1-dev branch. Discussion ---------- Add a data_help method in Form | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26331 | License | MIT | Doc PR | symfony/symfony-docs#9361 Add a form_help method in twig to display a help message in form. A `help` keyword is added to all FormType to define the message. Commits ------- 585ca28 Add return type hint 859ee03 Revert: remove comment line from twig templates d723756 Fix some mistakes c74e0dc Use spaceless balises in Twig templates 8b937ff Try without try/catch 32bf1f6 Test the renderHelp method in all Tests about help to skip them if necessary. 437b77e Skip renderHelp test as skipped if not override d84be70 Update composer files 075fcfd [FrameworkBundle] Add widgetAtt to formTable/form_row f1d13a8 Fix Fabpot.io 69ded67 Added form_help on horizontal design and removed special variable fd53bc5 Enable aria-described in row for all Templates 98065d3 fabpot.io fix edb95f8 Use array long syntax aada72c Set help option on nul as default f948147 Rename help id (snake_case) 77fa317 Fix Test 30deaa9 PSR fix bf4d08c Add aria-describedBy on input 1f3a15e Rename id 058489d Add an id to the help 6ea7a20 Remove vars option from form_help ba798df FrameworkBundle Tests 4f2581d Use array long syntax f15bc79 Fix coding standards c934e49 Add test without help set 8094804 Add Tests 067c681 Template for table, Foundation and Bootstrap 3 d3e3e49 Fix: check translation domain 2c2c045 Adapt existant tests 831693a Add trans filter e311838 Remove raw filter for help 8b97c1b Use a shortcut to acces help var in Twig template 1b89f9d Add a template fot div_layout c8914f5 Add a data_help method in Form
- Loading branch information
Showing
32 changed files
with
273 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_help.html.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php if (!empty($help)): ?> | ||
<p id="<?php echo $view->escape($id); ?>_help" class="help-text"><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($help, array(), $translation_domain) : $help); ?></p> | ||
<?php endif; ?> |
8 changes: 5 additions & 3 deletions
8
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_row.html.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<div> | ||
<?php echo $view['form']->label($form) ?> | ||
<?php echo $view['form']->errors($form) ?> | ||
<?php echo $view['form']->widget($form) ?> | ||
<?php $widgetAttr = empty($help) ? array() : array('attr' => array('aria-describedby' => $id.'_help')); ?> | ||
<?php echo $view['form']->label($form); ?> | ||
<?php echo $view['form']->errors($form); ?> | ||
<?php echo $view['form']->widget($form, $widgetAttr); ?> | ||
<?php echo $view['form']->help($form); ?> | ||
</div> |
2 changes: 1 addition & 1 deletion
2
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?> | ||
<?php if ($required): ?> required="required"<?php endif ?> | ||
<?php echo $attr ? ' '.$view['form']->block($form, 'attributes') : '' ?> | ||
<?php echo $attr ? ' '.$view['form']->block($form, 'attributes') : '' ?> |
4 changes: 3 additions & 1 deletion
4
src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_row.html.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
<tr> | ||
<?php $widgetAttr = empty($help) ? array() : array('attr' => array('aria-describedby' => $id.'_help')); ?> | ||
<td> | ||
<?php echo $view['form']->label($form); ?> | ||
</td> | ||
<td> | ||
<?php echo $view['form']->errors($form); ?> | ||
<?php echo $view['form']->widget($form); ?> | ||
<?php echo $view['form']->widget($form, $widgetAttr); ?> | ||
<?php echo $view['form']->help($form); ?> | ||
</td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.