Skip to content

Add help option to FormType #9361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed

Add help option to FormType #9361

wants to merge 7 commits into from

Conversation

mpiot
Copy link
Contributor

@mpiot mpiot commented Feb 28, 2018

Add documentation about the new feature symfony/symfony#26332

@javiereguiluz javiereguiluz added the Waiting Code Merge Docs for features pending to be merged label Feb 28, 2018
Copy link
Member

@wouterj wouterj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great feature & very complete doc PR! I've added some small comments, would be awesome if you can manage to fix them.


**type**: ``string`` **default**: null

Allows you to define a help text below the form field.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about something like: "Allows you to define extra information about the field, which will be rendered below the form field by default." (as you're allowed to change the layout of a form in every way you want)


$builder->add('name', null, array(
'help' => 'My helper message.',
));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please indent the array entry with 4 spaces and you have to add .. code-block:: php before this code example in order to render it as PHP code.

``view``
**type**: ``FormView``

Renders the text help for the given field.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Renders the text help" -> "Renders the help text" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed it too, but apparently, don't recognized.

symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Mar 27, 2018
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
-------

585ca28b8a Add return type hint
859ee03785 Revert: remove comment line from twig templates
d723756331 Fix some mistakes
c74e0dc2da Use spaceless balises in Twig templates
8b937ff43f Try without try/catch
32bf1f68ad Test the renderHelp method in all Tests about help to skip them if necessary.
437b77e81a Skip renderHelp test as skipped if not override
d84be700b2 Update composer files
075fcfd07c [FrameworkBundle] Add widgetAtt to formTable/form_row
f1d13a860c Fix Fabpot.io
69ded67643 Added form_help on horizontal design and removed special variable
fd53bc579a Enable aria-described in row for all Templates
98065d38b5 fabpot.io fix
edb95f8e44 Use array long syntax
aada72c5d4 Set help option on nul as default
f948147e38 Rename help id (snake_case)
77fa3178bd Fix Test
30deaa9b28 PSR fix
bf4d08c5ae Add aria-describedBy on input
1f3a15e33b Rename id
058489d7df Add an id to the help
6ea7a2054b Remove vars option from form_help
ba798dfdf4 FrameworkBundle Tests
4f2581d7da Use array long syntax
f15bc79df1 Fix coding standards
c934e496d2 Add test without help set
8094804522 Add Tests
067c681580 Template for table, Foundation and Bootstrap 3
d3e3e492df Fix: check translation domain
2c2c04549f Adapt existant tests
831693ad45 Add trans filter
e311838aed Remove raw filter for help
8b97c1b516 Use a shortcut to acces help var in Twig template
1b89f9d9dd Add a template fot div_layout
c8914f591e Add a data_help method in Form
symfony-splitter pushed a commit to symfony/twig-bridge that referenced this pull request Mar 27, 2018
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
-------

585ca28b8a Add return type hint
859ee03785 Revert: remove comment line from twig templates
d723756331 Fix some mistakes
c74e0dc2da Use spaceless balises in Twig templates
8b937ff43f Try without try/catch
32bf1f68ad Test the renderHelp method in all Tests about help to skip them if necessary.
437b77e81a Skip renderHelp test as skipped if not override
d84be700b2 Update composer files
075fcfd07c [FrameworkBundle] Add widgetAtt to formTable/form_row
f1d13a860c Fix Fabpot.io
69ded67643 Added form_help on horizontal design and removed special variable
fd53bc579a Enable aria-described in row for all Templates
98065d38b5 fabpot.io fix
edb95f8e44 Use array long syntax
aada72c5d4 Set help option on nul as default
f948147e38 Rename help id (snake_case)
77fa3178bd Fix Test
30deaa9b28 PSR fix
bf4d08c5ae Add aria-describedBy on input
1f3a15e33b Rename id
058489d7df Add an id to the help
6ea7a2054b Remove vars option from form_help
ba798dfdf4 FrameworkBundle Tests
4f2581d7da Use array long syntax
f15bc79df1 Fix coding standards
c934e496d2 Add test without help set
8094804522 Add Tests
067c681580 Template for table, Foundation and Bootstrap 3
d3e3e492df Fix: check translation domain
2c2c04549f Adapt existant tests
831693ad45 Add trans filter
e311838aed Remove raw filter for help
8b97c1b516 Use a shortcut to acces help var in Twig template
1b89f9d9dd Add a template fot div_layout
c8914f591e Add a data_help method in Form
fabpot added a commit to symfony/symfony that referenced this pull request Mar 27, 2018
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
@mpiot
Copy link
Contributor Author

mpiot commented Mar 29, 2018

status: need review, code merged

@xabbuh xabbuh added this to the 4.1 milestone Apr 20, 2018
@xabbuh xabbuh added Form and removed Waiting Code Merge Docs for features pending to be merged labels Apr 20, 2018
@@ -42,6 +42,7 @@ option defaults to 120 years ago to the current year.
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `mapped`_ |
| | - `help`_ |
Copy link
Member

@xabbuh xabbuh Apr 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be between disabled and invalid_message IMO to keep options in alphabetical order

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same in the other files

Copy link
Contributor

@ndench ndench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, except for the comment by @xabbuh about alphabetical ordering. Thanks for the contribution, I was looking for this exact documentation just the other day.

@mpiot
Copy link
Contributor Author

mpiot commented Apr 25, 2018

I'll change the order :-)

@xabbuh xabbuh changed the base branch from master to 4.1 May 8, 2018 08:41
javiereguiluz added a commit that referenced this pull request May 16, 2018
This PR was squashed before being merged into the 4.1 branch (closes #9361).

Discussion
----------

Add help option to FormType

Add documentation about the new feature symfony/symfony#26332

Commits
-------

5bdf708 Add help option to FormType
@javiereguiluz
Copy link
Member

@mpiot thanks for providing these docs and congrats on your first Symfony Docs contribution. Also, thanks for contributing this great feature to Symfony forms.

@mpiot mpiot deleted the form_help branch October 18, 2018 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants