Skip to content
Merged
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
28 changes: 28 additions & 0 deletions bundles/prepend_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,34 @@ method::

The ``prependExtension()`` method, like ``prepend()``, is called only at compile time.

Alternatively, you can use the ``prepend`` parameter of the
:method:`Symfony\\Component\\DependencyInjection\\Loader\\ContainerConfigurator::extension`
method::

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;

class FooBundle extends AbstractBundle
{
public function prependExtension(ContainerConfigurator $containerConfigurator, ContainerBuilder $containerBuilder): void
{
// ...

$containerConfigurator->extension('framework', [
'cache' => ['prefix_seed' => 'foo/bar'],
], prepend: true);

// ...
}
}

.. versionadded:: 7.1

The ``prepend`` parameter of the
:method:`Symfony\\Component\\DependencyInjection\\Loader\\ContainerConfigurator::extension`
method was added in Symfony 7.1.

More than one Bundle using PrependExtensionInterface
----------------------------------------------------

Expand Down