Skip to content

Add new (dormant) compiler pass that can modify default form themes#1030

Merged
werrolf merged 1 commit into
release/3.0.7from
enh/support-global-form-theme-replacements
Mar 15, 2019
Merged

Add new (dormant) compiler pass that can modify default form themes#1030
werrolf merged 1 commit into
release/3.0.7from
enh/support-global-form-theme-replacements

Conversation

@werrolf

@werrolf werrolf commented Sep 27, 2018

Copy link
Copy Markdown
Contributor

Pull adds a compiler pass class that can rewrite the default form theme(s). Pass accepts from, to constructor arguments.
Pull does not engage this compiler pass in any way.

This is intended to

  • allow Mapbender core to wrestle control over default form theming away from FOM and Mapbender Starter; the main issue here is that rolling out theming fixes across three repositories in a concerted fashion is complex and error prone
  • improve project ability to model global theming changes as bundles

Example usage:
Place into any Bundle class's build method (MapbenderCoreBundle works fine):

$container->addCompilerPass(new RewriteFormThemeCompilerPass('FOMCoreBundle:Form:fields.html.twig', 'bootstrap_3_layout.html.twig'));

This makes every form in the entire Mapbender backend render in Bootstrap 3 theme. There are some layouting quirks with "extended collections", "region properties" etc. So this is not recommended for general use. It just proves that the replacement method works on a base level.

@werrolf werrolf requested a review from DavidPatzke September 27, 2018 18:00
@werrolf werrolf merged commit 1707640 into release/3.0.7 Mar 15, 2019
@werrolf werrolf deleted the enh/support-global-form-theme-replacements branch March 21, 2019 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant