diff --git a/Controller/TranslationController.php b/Controller/TranslationController.php index b908145c..49620aaa 100644 --- a/Controller/TranslationController.php +++ b/Controller/TranslationController.php @@ -28,7 +28,7 @@ public function overviewAction() $stats = $this->get('lexik_translation.overview.stats_aggregator')->getStats(); - return $this->render('LexikTranslationBundle:Translation:overview.html.twig', array( + return $this->render('@LexikTranslationBundle/Translation/overview.html.twig', array( 'layout' => $this->container->getParameter('lexik_translation.base_layout'), 'locales' => $this->getManagedLocales(), 'domains' => $storage->getTransUnitDomains(), @@ -49,7 +49,7 @@ public function gridAction() $tokens = $this->get('lexik_translation.token_finder')->find(); } - return $this->render('LexikTranslationBundle:Translation:grid.html.twig', array( + return $this->render('@LexikTranslationBundle/Translation/grid.html.twig', array( 'layout' => $this->container->getParameter('lexik_translation.base_layout'), 'inputType' => $this->container->getParameter('lexik_translation.grid_input_type'), 'autoCacheClean' => $this->container->getParameter('lexik_translation.auto_cache_clean'), @@ -102,7 +102,7 @@ public function newAction(Request $request) return $this->redirect($this->generateUrl($redirectUrl)); } - return $this->render('LexikTranslationBundle:Translation:new.html.twig', array( + return $this->render('@LexikTranslationBundle/Translation/new.html.twig', array( 'layout' => $this->container->getParameter('lexik_translation.base_layout'), 'form' => $form->createView(), )); diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index a5775d4f..eaf23392 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -37,7 +37,7 @@ public function getConfigTreeBuilder() ->children() ->scalarNode('base_layout') ->cannotBeEmpty() - ->defaultValue('LexikTranslationBundle::layout.html.twig') + ->defaultValue('@LexikTranslationBundle/layout.html.twig') ->end() ->arrayNode('fallback_locale') diff --git a/DependencyInjection/LexikTranslationExtension.php b/DependencyInjection/LexikTranslationExtension.php index 6b1291d3..2a869ed8 100644 --- a/DependencyInjection/LexikTranslationExtension.php +++ b/DependencyInjection/LexikTranslationExtension.php @@ -8,6 +8,7 @@ use Symfony\Component\Config\Definition\Processor; use Symfony\Component\Config\Resource\DirectoryResource; use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Parameter; use Symfony\Component\DependencyInjection\Definition; @@ -23,7 +24,7 @@ * * @author Cédric Girard */ -class LexikTranslationExtension extends Extension +class LexikTranslationExtension extends Extension implements PrependExtensionInterface { /** * {@inheritdoc} @@ -131,6 +132,19 @@ public function buildCacheCleanListenerDefinition(ContainerBuilder $container, $ $container->setDefinition('lexik_translation.listener.clean_translation_cache', $listener); } + public function prepend(ContainerBuilder $container) + { + if (!$container->hasExtension('twig')) { + return; + } + + $container->prependExtensionConfig('twig', [ + 'paths' => [ + '%kernel.project_dir%/vendor/lexik/translation-bundle/Resources/views' => 'LexikTranslationBundle' + ] + ]); + } + /** * Build the 'lexik_translation.translation_storage' service definition. * @@ -182,6 +196,7 @@ protected function buildTranslationStorageDefinition(ContainerBuilder $container $storageDefinition = new Definition(); $storageDefinition->setClass($container->getParameter(sprintf('lexik_translation.%s.translation_storage.class', $storage))); $storageDefinition->setArguments($args); + $storageDefinition->setPublic(true); $container->setDefinition('lexik_translation.translation_storage', $storageDefinition); } diff --git a/Resources/views/Translation/grid.html.twig b/Resources/views/Translation/grid.html.twig index 64bb78f7..602b3810 100644 --- a/Resources/views/Translation/grid.html.twig +++ b/Resources/views/Translation/grid.html.twig @@ -12,11 +12,11 @@ {% block lexik_content %}
{% block lexik_toolbar %} - {% include 'LexikTranslationBundle:Translation:_gridToolbar.html.twig' %} + {% include '@LexikTranslationBundle/Translation/_gridToolbar.html.twig' %} {% endblock lexik_toolbar %} {% block lexik_data_grid %} - {% include 'LexikTranslationBundle:Translation:_ngGrid.html.twig' %} + {% include '@LexikTranslationBundle/Translation/_ngGrid.html.twig' %} {% endblock lexik_data_grid %}
{% endblock %}