Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Commit 06ee2ef

Browse files
author
Gustavo Nieves
authored
Update docs with PHP file config
Symfony 6 will recommend the use of PHP files instead of YAML for config, so it's convenient to show users how to perform PHP config from now on.
1 parent 1b3c8ca commit 06ee2ef

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $bundles = array(
3434

3535
Add the following to your config file:
3636

37-
**NOTE** If you're using symfony 4, the config will be in `config/packages/ewz_recaptcha.yaml`. The local dev enviroment has its own config in `config/packages/dev/ewz_recaptcha.yaml`.
37+
**NOTE**: If you're using symfony 4, the config will be in `config/packages/ewz_recaptcha.yaml`. The local dev enviroment has its own config in `config/packages/dev/ewz_recaptcha.yaml`.
3838

3939
``` yaml
4040
# app/config/config.yml
@@ -112,6 +112,25 @@ ewz_recaptcha:
112112
verify_host: true
113113
```
114114

115+
**NOTE**: If you're using symfony 5 and want to configure the bundle with PHP files instead of YAML, the configuration is like this:
116+
117+
``` php
118+
// config/packages/ewz_recaptcha.php
119+
120+
<?php declare(strict_types=1);
121+
122+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
123+
124+
return static function (ContainerConfigurator $configurator): void
125+
{
126+
$configurator->extension('ewz_recaptcha', [
127+
'public_key' => 'here_is_your_public_key',
128+
'private_key' => 'here_is_your_private_key',
129+
'locale_key' => '%kernel.default_locale%'
130+
]);
131+
};
132+
```
133+
115134
Congratulations! You're ready!
116135

117136
## Basic Usage

0 commit comments

Comments
 (0)