Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Load service
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois CONTE committed Dec 27, 2019
1 parent 148c7f1 commit f5b6df8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions DependencyInjection/OdandbSimpleCorsExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Odandb\SimpleCorsBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;

class OdandbSimpleCorsExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader(
$container,
new FileLocator(__DIR__.'/../Resources/config')
);
$loader->load('services.yml');
}
}
6 changes: 6 additions & 0 deletions OdandbSimpleCorsBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Odandb\SimpleCorsBundle;

use Odandb\SimpleCorsBundle\DependencyInjection\OdandbSimpleCorsExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;

Expand All @@ -11,4 +12,9 @@ public function build(ContainerBuilder $container): void
{
parent::build($container);
}

public function getContainerExtension()
{
return new OdandbSimpleCorsExtension();
}
}

0 comments on commit f5b6df8

Please sign in to comment.