phone-number-bundle
phone-number-bundle copied to clipboard
Refactor Twig Compiler Pass
Hi! I've added some basic support for SF4 and refactored the Twig template compiler pass to allow for a configuration parameter rather than automatically picking a template (needed it to squish the country widget into an input-group)
Still open:
- updated doc
- didn't look at the PHP templating stuff as I'm not familiar with it
This is my first PR, so if there's anything missing please let me know :)
SF4 compatibility exist and waiting for merge in https://github.com/misd-service-development/phone-number-bundle/pull/153
Okay, I’ll wait for the merge and rebase if necessary
@dTatham At least some of this has been covered by other PRs - could you rebase so we can check whatever's left? Thanks.
Alrighty, here's what's left after the rebase:
- Switched to relying on configuration to pick the template (as prelude to turning it into a SF4 recipe).
- Introduces a new parameter
misd_phone_number.templatewhich makes it easier to modify the Twig form theme. - Extended the if/else sequence by bootstrap 4 template
- I kept the if/else sequence which ensures the template is dropped in right behind the form theme to keep the PR as minimally invasive as possible; however - with the growing number of form themes, should this be dropped in favor of simply dropping in the phone number theme last?
I'm not sure if DependencyInjection/Compiler/FormPhpTemplateCompilerPass.php needs an update as well as I'm not familiar with Symfony PHP theming.