Skip to content

[DependencyInjection] Updating prepend extension capabilities #19738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2024
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
Loading