I am developing a symfony2
application and I am trying to include my custom yaml config located in /src/AppBundle/Resources/Config/general.yml
I have followed example provided here http://symfony.com/doc/current/cookbook/bundles/extension.html and created in src/AppBundle/DependencyInjection/AppExtension.php
file with the following content:
<?php
namespace AppBundle\DependencyInjection;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Translation\Loader\YamlFileLoader;
class AppExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader(
$container,
new FileLocator("@AppBundle/Resources/config')
);
$loader->load('general.yml');
}
}
However, I stuck at this point and don't know how to make symfony execute this file and load the config.