Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
In the bundle you have a DependencyInjection/AcmeAppExtension.php
.
If its contents are brought approximately to this form, then it should work (although I myself have not tried to do this).
<?php
namespace Acme\AppBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
* @codeCoverageIgnore
*/
class AcmeAppExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$this->processConfiguration($configuration, $configs);
$loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__ . '/../config/'));
$loader->load('services.php');
if ($container->getParameter('kernel.environment') == 'dev') {
$loader->load('services_dev.php');
}
if ($container->getParameter('kernel.environment') == 'test') {
$loader->load('services_test.php');
}
}
}
It is possible to specify in the php parameters (as when creating a bundle).
Although I can't imagine the reason to create php configs.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question