vendor/philiplb/crudlexsymfony4bundle/CRUDlexSymfony4Bundle.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the CRUDlexSymfony4Bundle package.
  4.  *
  5.  * (c) Philip Lehmann-Böhm <philip@philiplb.de>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace philiplb\CRUDlexSymfony4Bundle;
  11. use CRUDlex\Service;
  12. use Symfony\Component\HttpKernel\Bundle\Bundle;
  13. use Symfony\Component\Translation\Loader\YamlFileLoader;
  14. /**
  15.  * Class CRUDlexSymfony4Bundle, the bundle defining class.
  16.  * @package philiplb\CRUDlexSymfony4Bundle
  17.  */
  18. class CRUDlexSymfony4Bundle extends Bundle
  19. {
  20.     /**
  21.      * Setups the templates.
  22.      */
  23.     protected function setupTemplates()
  24.     {
  25.         $this->container->get('twig')->getLoader()->addPath(__DIR__.'/../crudlex/src/views/''crud');
  26.     }
  27.     /**
  28.      * Setups the available locales.
  29.      */
  30.     protected function setupLocales()
  31.     {
  32.         $translator $this->container->get('translator');
  33.         $locales   Service::getLocales();
  34.         $localeDir __DIR__.'/../crudlex/src/locales';
  35.         $translator->addLoader('yaml', new YamlFileLoader());
  36.         foreach ($locales as $locale) {
  37.             $translator->addResource('yaml'$localeDir.'/'.$locale.'.yml'$locale);
  38.         }
  39.     }
  40.     /**
  41.      * {@inheritdoc}
  42.      */
  43.     public function getParent()
  44.     {
  45.         return null;
  46.     }
  47.     /**
  48.      * {@inheritdoc}
  49.      */
  50.     public function boot()
  51.     {
  52.         // $this->setupTemplates();
  53.         $this->setupLocales();
  54.     }
  55. }