Skip to content

Commit

Permalink
adding service.yml to register service
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Dziemba <[email protected]>
  • Loading branch information
adziemba committed Jan 16, 2018
1 parent 9edf1b9 commit 71fe43d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

"autoload":{
"psr-4": {
"MenAtWork\\ExtendedEditorsBundle\\": "src/"
"MenAtWork\\ExtendedEditorsBundle\\": "src"
}
},

Expand Down
7 changes: 6 additions & 1 deletion src/DependencyInjection/ExtendedEditorsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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

/**
Expand All @@ -24,6 +24,11 @@ class ExtendedEditorsExtension extends Extension
*/
public function load(array $mergedConfig, ContainerBuilder $container)
{
$loader = new YamlFileLoader(
$container,
new FileLocator(__DIR__.'/../Resources/config')
);

$loader->load('services.yml');
}
}
3 changes: 3 additions & 0 deletions src/Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
services:
maw.extendededitorsbundle.listener.replaceInsertTags:
class: MenAtWork\ExtendedEditorsBundle\Contao\InsertTags
4 changes: 2 additions & 2 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
/**
* Hooks
*/
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = array('MenAtWork\ExtendedEditorsBundle\Contao\InsertTags', 'ReplaceInsertTags');
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = array('MenAtWork\ExtendedEditorsBundle\Contao\InsertTags', 'ReplaceLanguageTags');
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = array('maw.extendededitorsbundle.listener.replaceInsertTags', 'ReplaceInsertTags');
$GLOBALS['TL_HOOKS']['replaceInsertTags'][] = array('maw.extendededitorsbundle.listener.replaceInsertTags', 'ReplaceLanguageTags');

0 comments on commit 71fe43d

Please sign in to comment.