Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\CompilerPass;
- use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
- use Symfony\Component\DependencyInjection\ContainerBuilder;
- use Symfony\Component\DependencyInjection\Definition;
- use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
- class SessionCompilerPass implements CompilerPassInterface
- {
- public function process(ContainerBuilder $container)
- {
- $fooBag = new Definition(AttributeBag::class, ['_foo']);
- $fooBag->addMethodCall('setName', ['foo_bag']);
- $container->getDefinition('session')
- ->addMethodCall('registerBag', [$fooBag]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement