55 lines
1.7 KiB
PHP
55 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Pcm\BadgeBundle;
|
|
|
|
use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
|
|
|
|
final class PcmBadgeBundle extends AbstractBundle
|
|
{
|
|
public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
|
|
{
|
|
/**
|
|
* Load the services defined in services.yaml into the container.
|
|
*/
|
|
$container->import('../config/services.yaml');
|
|
|
|
/**
|
|
* The "$config" variable contains an array representing the
|
|
* configuration and it's values.
|
|
*
|
|
* We can use it to configure the service container, for example
|
|
* by passing in arguments to any services we have defined.
|
|
*
|
|
* (see services.yaml)
|
|
*/
|
|
// $container->services()
|
|
// ->get('pcm_example.greeting')
|
|
// ->arg('$name', $config['name'])
|
|
// ;
|
|
}
|
|
|
|
public function configure(DefinitionConfigurator $definition): void
|
|
{
|
|
/**
|
|
* Import the config definition (see definition.php)
|
|
*/
|
|
$definition->import('../config/definition.php');
|
|
}
|
|
|
|
public function prependExtension(ContainerConfigurator $container, ContainerBuilder $builder): void
|
|
{
|
|
$builder->prependExtensionConfig('twig', [
|
|
'paths' => [
|
|
'templates/bundles/Pcm/BadgeBundle/' => null,
|
|
dirname(__DIR__).'/templates/' => null,
|
|
],
|
|
]);
|
|
}
|
|
}
|
|
|