8000 Add a data_help method in Form by mpiot · Pull Request #26332 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Add a data_help method in Form #26332

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

Merged
merged 35 commits into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c8914f5
Add a data_help method in Form
Feb 27, 2018
1b89f9d
Add a template fot div_layout
Feb 27, 2018
8b97c1b
Use a shortcut to acces help var in Twig template
Feb 27, 2018
e311838
Remove raw filter for help
Feb 27, 2018
831693a
Add trans filter
Feb 27, 2018
2c2c045
Adapt existant tests
Feb 27, 2018
d3e3e49
Fix: check translation domain
Feb 27, 2018
067c681
Template for table, Foundation and Bootstrap 3
Feb 28, 2018
8094804
Add Tests
Feb 28, 2018
c934e49
Add test without help set
Feb 28, 2018
f15bc79
Fix coding standards
Feb 28, 2018
4f2581d
Use array long syntax
Feb 28, 2018
ba798df
FrameworkBundle Tests
Feb 28, 2018
6ea7a20
Remove vars option from form_help
Feb 28, 2018
058489d
Add an id to the help
Mar 1, 2018
1f3a15e
Rename id
Mar 1, 2018
bf4d08c
Add aria-describedBy on input
Mar 1, 2018
30deaa9
PSR fix
Mar 1, 2018
77fa317
Fix Test
Mar 1, 2018
f948147
Rename help id (snake_case)
Mar 1, 2018
aada72c
Set help option on nul as default
Mar 1, 2018
edb95f8
Use array long syntax
Mar 1, 2018
98065d3
fabpot.io fix
Mar 1, 2018
fd53bc5
Enable aria-described in row for all Templates
Mar 1, 2018
69ded67
Added form_help on horizontal design and removed special variable
Nyholm Mar 18, 2018
f1d13a8
Fix Fabpot.io
mpiot Mar 20, 2018
075fcfd
[FrameworkBundle] Add widgetAtt to formTable/form_row
mpiot Mar 20, 2018
d84be70
Update composer files
mpiot Mar 21, 2018
437b77e
Skip renderHelp test as skipped if not override
mpiot Mar 21, 2018
32bf1f6
Test the renderHelp method in all Tests about help to skip them if ne…
mpiot Mar 21, 2018
8b937ff
Try without try/catch
mpiot Mar 21, 2018
c74e0dc
Use spaceless balises in Twig templates
mpiot Mar 22, 2018
d723756
Fix some mistakes
mpiot Mar 23, 2018
859ee03
Revert: remove comment line from twig templates
mpiot Mar 23, 2018
585ca28
Add return type hint
mpiot Mar 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add trans filter
  • Loading branch information
Mathieu Piot authored and mpiot committed Mar 23, 2018
commit 831693ad459743405e19c951a179308af31c05e4
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,6 @@

{% block form_help -%}
{% if help is not empty %}
<small class="form-text text-muted">{{ help }}</small>
<small class="form-text text-muted">{{ help|trans }}</small>
Copy link
Member

Choose a reason for hiding this comment

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

Let's make sure it respects the translation domain.

{{ translation_domain is same as(false) ? help : help|trans({}, translation_domain) }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I edit it. (I don't really know what is it, but I trust you ;-))

Copy link
Member

Choose a reason for hiding this comment

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

It checks if translation_domain is false, it it is we just print help. If it is not false we use translation with that domain.

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 was thinking about TranslationDomain, I don't know what it is, I'd watch.

Copy link
Member
@Nyholm Nyholm Feb 27, 2018

Choose a reason for hiding this comment

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

Have a look here: http://symfony.com/doc/current/components/translation.html#using-message-domains

It is basically a way to categorize translation messages.

Make sure you add this fix every time you print help. (ie in the form_div_layout.html.twig)

Copy link
Contributor Author
@mpiot mpiot Feb 27, 2018

Choose a reason for hiding this comment

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

Thanks, and it's done :-) (it's interresting to do PR, it permit to learn lot of things:-))

{% endif %}
{%- endblock form_help %}
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@

{% block form_help -%}
{% if help is not empty %}
<p class="form-help">{{ help }}</p>
<p class="form-help">{{ help|trans }}</p>
{% endif %}
{%- endblock form_help %}

Expand Down
0