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
9 changes: 9 additions & 0 deletions bundles/prepend_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,22 @@ method::
$containerBuilder->prependExtensionConfig('framework', [
'cache' => ['prefix_seed' => 'foo/bar'],
]);

// prepend config from a file
$containerConfigurator->import('../config/packages/cache.php');
}
}

.. note::

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

.. deprecated:: 7.1

The :method:`Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator::import`
method behavior was modified in Symfony 7.1 to prepend config instead of appending. This behavior change only
affects to the ``prependExtension()`` method.

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