Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ as integration of other related components:
.. code-block:: php

// config/packages/framework.php
use Symfony\Config\FrameworkConfig;
namespace Symfony\Config;

return static function (FrameworkConfig $framework): void {
$framework->form()->enabled(true);
};
return [
new FrameworkConfig([
'form' => true,
]),
];

There are two different ways of creating friendly configuration for a bundle:

Expand Down Expand Up @@ -148,13 +150,16 @@ can add some configuration that looks like this:
.. code-block:: php

// config/packages/acme_social.php
use Symfony\Config\AcmeSocialConfig;

return static function (AcmeSocialConfig $acmeSocial): void {
$acmeSocial->twitter()
->clientId(123)
->clientSecret('your_secret');
};
namespace Symfony\Config;

return [
new AcmeSocialConfig([
'twitter' => [
'client_id' => 123,
'client_secret' => 'your_secret',
],
]),
];

The basic idea is that instead of having the user override individual
parameters, you let the user configure just a few, specifically created,
Expand Down
14 changes: 7 additions & 7 deletions bundles/prepend_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,19 @@ registered and the ``entity_manager_name`` setting for ``acme_hello`` is set to
.. code-block:: php

// config/packages/acme_something.php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
namespace Symfony\Config;

return static function (ContainerConfigurator $container): void {
$container->extension('acme_something', [
return [
new AcmeSomethingConfig([
// ...
'use_acme_goodbye' => false,
'entity_manager_name' => 'non_default',
]);
$container->extension('acme_other', [
]),
new AcmeOtherConfig([
// ...
'use_acme_goodbye' => false,
]);
};
]),
];

Prepending Extension in the Bundle Class
----------------------------------------
Expand Down
Loading
Loading