I am using Symfony 4 with the preconfigured "App"-Bundle (it does not have "Bundle" in its name) and added an extension as below. When accessing routes, the debug output from the extension is not outputted so the extension logic is not running. Why? I did not register the extension anywhere, just followed the manual at http://symfony.com/doc/current/bundles/extension.html.
<?php
namespace App\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
class AppExtension extends Extension
{
public function __construct()
{
echo "EXTLOAD000|";
}
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
echo "EXTLOAD|";
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setParameter('app_transformer_configuration', $config['transformer_configuration']);
}
}
The code except for the debug is from this site: https://blog.bam.tech/developper-news/make-a-versioned-api-with-symfony (Symfony 2.7)