Closed jmsche closed 6 years ago
And I have
You have requested a non-existent parameter "twig.form.resources".
I fixed this for myself by creating config/ewz_recaptcha.yaml
wich the following content:
parameters:
templating.engines: [ 'twig' ]
twig.form.resources: []
ewz_recaptcha:
public_key: ''
private_key: ''
Templating component seems to be deprecated. Then Twig should be called directly instead of specifying extra config.
In my project I needed to do the following in order to make it work (which is probably caused by the custom form_theme used):
twig:
form_themes:
- "@EWZRecaptcha/Form/ewz_recaptcha_widget.html.twig"
- "form/form_layout.html.twig"
Next to that, make sure to set the parameter used to determine the engine so that it will not load anything by itself (as it breaks):
parameters:
templating.engines: [ 'none' ]
Edit: Removed the namespace alias as I found that you need to reference the bundle without the Bundle postfix.
Also the old syntax of Bundle:Path:To:File.html.twig
is deprecated, instead the @Bundle/Path/To/File.html.twig
should be used. Without this change, we currently cannot use Symfony 3.4+'s new default_path for overriding template files. See https://github.com/symfony/symfony/issues/25661
@excelwebzone should I raise another issue about the syntax?
No need, I just merged the fix in #196 and tagged it.
The fix has nothing to do with https://github.com/excelwebzone/EWZRecaptchaBundle/issues/188#issuecomment-355085803
Sure go ahead and submit a PR and I will review it and merge if good.
I just found that when you use the templating.engines: [ 'none' ]
in your parameters, the error messages in the production environment will break.
Unfortunately, you can not leave it out, as otherwise you cannot use this bundle with the new Twig syntax...
When trying to install the bundle for Symfony 4, the following error is thrown: