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

Commit

Permalink
fix extension configuration and registering
Browse files Browse the repository at this point in the history
  • Loading branch information
sstok committed Jun 19, 2015
1 parent 1df544f commit f0f6ab4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/DependencyInjection/Compiler/ExtensionPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ public function process(ContainerBuilder $container)

private function processTwig(ContainerBuilder $container)
{
$reflection = new \ReflectionClass(TwigDatagridExtension::class);
$extensionFolder = dirname(dirname(dirname($reflection->getFileName())));

$container->getDefinition('twig.loader.filesystem')->addMethodCall(
'addPath',
[dirname((new \ReflectionClass(TwigDatagridExtension::class))->getFileName().'/../').'/Resources/views/theme']
[$extensionFolder.'/Resources/theme']
);
}

Expand Down
5 changes: 3 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ public function getConfigTreeBuilder()
$rootNode = $treeBuilder->root($this->configName);

$rootNode
->addDefaultsIfNotSet()
->children()
->arrayNode('twig')
->addDefaultChildrenIfNoneSet()
->addDefaultsIfNotSet()
->children()
->arrayNode('themes')
->prototype('scalar')
->prototype('scalar')->end()
->defaultValue(['datagrid.html.twig'])
->end()
->end()
Expand Down
2 changes: 1 addition & 1 deletion src/RollerworksDatagridBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Rollerworks\Component\DatagridBundle;

use Rollerworks\Component\DatagridBundle\DependencyInjection\Compiler\ExtensionPass;
use Rollerworks\Component\DatagridBundle\DependencyInjection\DatagridExtension;
use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\ExtensionPass;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down

0 comments on commit f0f6ab4

Please sign in to comment.