phone-number-bundle icon indicating copy to clipboard operation
phone-number-bundle copied to clipboard

Refactor Twig Compiler Pass

Open dTatham opened this issue 7 years ago • 4 comments

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 :)

dTatham avatar Dec 02 '17 22:12 dTatham

SF4 compatibility exist and waiting for merge in https://github.com/misd-service-development/phone-number-bundle/pull/153

piotrantosik avatar Dec 04 '17 14:12 piotrantosik

Okay, I’ll wait for the merge and rebase if necessary

dTatham avatar Dec 04 '17 14:12 dTatham

@dTatham At least some of this has been covered by other PRs - could you rebase so we can check whatever's left? Thanks.

robhogan avatar Jan 11 '18 14:01 robhogan

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.template which 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.

dTatham avatar Jan 12 '18 23:01 dTatham