excelwebzone / EWZRecaptchaBundle

This bundle provides easy reCAPTCHA form field for Symfony.
MIT License
396 stars 160 forks source link

Why form ressource is load by the extension ? #128

Open lpxavi opened 7 years ago

lpxavi commented 7 years ago

Hi,

I have noticed the form resources are loaded by the bundle extension.

In the Symfony documentation, form resources are loaded in framework config (https://symfony.com/doc/current/form/form_customization.html#making-application-wide-customizations).

Twig engine :

# app/config/config.yml
twig:
    form_themes:
       - 'form/ewz_recaptcha_widget.html.twig'

PHP engine :

# app/config/config.yml
framework:
    templating:
        form:
            resources:
                - 'EWZRecaptchaBundle:Form'

Why do you choose to use the bundle extension to load form resource ?

Tks you !

ninsuo commented 6 years ago

Hi,

Indeed, on a Symfony 2 project I actually needed to import this bundle at the very end of my AppKernel's registerBundles(), otherwise my other twig form themes weren't registered.

README.md examples use {% form_theme %} so it was quite an unexpected behavior. I'm also against auto loading the form theme.

Cheers,