Reputation: 11
I want to split my application to two bundles.
Back-end bundle which will be something like CMS admin(reusable to another projects), and Front-end bundle.
I moved whole backend application including controllers, templates and model to new bundle, but I have a problem with 3rd-party bundles on which my project is dependent.
For example AsseticBundle. When I add assetic configuration to BackendBundle/config.yml i recieve a exception.
There is no extension able to load the configuration for "assetic"
Is there some good tutorial showing how to split application to two cooperating bundles with one config and both dependent to 3rd-party libraries?
Thanks for any advice.
Upvotes: 1
Views: 243
Reputation: 24298
If I understand you correctly, you're trying to add 3rd party bundle configuration to your own bundle config.
This can be achieved only in app/config/config.yml
, which is loaded by default by Symfony. It's the only place where Symfony looks.
What you can do, is prepend configuration via own extension. That can be placed in your bundle:
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
class BackendBundleExtension extends Extension implements PrependExtensionInterface
{
public function prepend(ContainerBuilder $container)
{
$container->prependExtensionConfig('assetic', array(
'key' => 'value'
));
}
}
Let me know, if this is sufficient explanation.
Upvotes: 1