[Form] Allow to disable and customize PercentType symbol#30433
[Form] Allow to disable and customize PercentType symbol#30433fabpot merged 2 commits intosymfony:masterfrom OskarStark:allow-toggling-and-customising-percentage-symbol
Conversation
|
@OskarStark Do you think it's possible to keep ownership of the commit to the original author? |
|
I am not sure, I talked to @xabbuh and we decided to create a new PR, the repository of the original author is deleted and I don't have some access to get the commits somehow. |
|
ok, fair enough, can you fixed fabbot issues (mainly array() -> [])? |
sure thing, will have a look
still onto it and try to understand whats wrong here 👍 |
|
normal and deps=low build failures are not related to this change. deps=high needs to be skipped |
|
Looks like the tests are 💚 |
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php
Outdated
Show resolved
Hide resolved
|
@fabpot I applied your comments |
src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php
Outdated
Show resolved
Hide resolved
|
Thank you @OskarStark. |
…ol (Ken Stanley, OskarStark) This PR was merged into the 4.3-dev branch. Discussion ---------- [Form] Allow to disable and customize PercentType symbol | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #28796 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#11078 <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> ## `PercentType` `symbol` option As of this writing, Symfony will forcibly append a percentage sign (`%`) to all input fields that are of the PercentType form type. This PR will introduce a boolean flag called `symbol` that, when `false`, will not display the percentage sign. Each of the default layouts that define percent_widget will respect this option. You could also use a customised string as value for `symbol` option. By default, this new option will be set to `true` so that it maintains backward compatibility. The unit tests have been updated where appropriate, and a new unit test has been added (as appropriate). Commits ------- 53c5f41 [Form] Allow to disable and customize PercentType symbol 9aeaea0 Add ‘symbol’ option to PercentType
… (OskarStark) This PR was merged into the master branch. Discussion ---------- Docs for PercentType disable/customize percent character Docs for symfony/symfony#30433 Closes #10464 Commits ------- 16b2e4b Docs for PercentType disable/customize percent character
PercentTypesymboloptionAs of this writing, Symfony will forcibly append a percentage sign (
%) to all input fields that are of the PercentType form type. This PR will introduce a boolean flag calledsymbolthat, whenfalse, will not display the percentage sign. Each of the default layouts that define percent_widget will respect this option. You could also use a customised string as value forsymboloption.By default, this new option will be set to
trueso that it maintains backward compatibility. The unit tests have been updated where appropriate, and a new unit test has been added (as appropriate).