public static function createTwigLoader(ContainerInterface $container): LoaderInterface
    {
        $options = self::resolveOptions($container->get('config'));

        $loaders     = [];
        $twigOptions = $options['engines']['twig'];
        $loader      = new TwigLoader($container->get(FinderContract::class));

        if (isset($twigOptions['file_extension'])) {
            $loader->setExtension($twigOptions['file_extension']);
        }

        $loaders[] = $loader;

        if (isset($twigOptions['templates']) && \is_array($twigOptions['templates'])) {
            $loaders[] = new ArrayLoader($twigOptions['templates']);
        }

        if (isset($twigOptions['loaders']) && \is_array($twigOptions['loaders'])) {
            $loaders = \array_merge($loaders, $twigOptions['loaders']);
        }

        return new ChainLoader($loaders);
    }
public static function createTwigLoader(ContainerInterface $container): LoaderInterface
    {
        $options = self::resolveOptions($container->get('config'));

        $loaders     = [];
        $twigOptions = $options['engines']['twig'];
        $loader      = new TwigLoader($container->get(FinderContract::class));

        if (isset($twigOptions['file_extension'])) {
            $loader->setExtension($twigOptions['file_extension']);
        }

        $loaders[] = $loader;

        if (isset($twigOptions['templates']) && \is_array($twigOptions['templates'])) {
            $loaders[] = new ArrayLoader($twigOptions['templates']);
        }

        if (isset($twigOptions['loaders']) && \is_array($twigOptions['loaders'])) {
            $loaders = \array_merge($loaders, $twigOptions['loaders']);
        }

        return new ChainLoader($loaders);
    }
public static function createTwigLoader ( ContainerInterface $ container ) : LoaderInterface { $ options = self :: resolveOptions ( $ container -> get ( 'config' ) ) ; $ loaders = [ ] ; $ twigOptions = $ options [ 'engines' ] [ 'twig' ] ; $ loader = new TwigLoader ( $ container -> get ( FinderContract :: class ) ) ; if ( isset ( $ twigOptions [ 'file_extension' ] ) ) { $ loader -> setExtension ( $ twigOptions [ 'file_extension' ] ) ; } $ loaders [ ] = $ loader ; if ( isset ( $ twigOptions [ 'templates' ] ) && \ is_array ( $ twigOptions [ 'templates' ] ) ) { $ loaders [ ] = new ArrayLoader ( $ twigOptions [ 'templates' ] ) ; } if ( isset ( $ twigOptions [ 'loaders' ] ) && \ is_array ( $ twigOptions [ 'loaders' ] ) ) { $ loaders = \ array_merge ( $ loaders , $ twigOptions [ 'loaders' ] ) ; } return new ChainLoader ( $ loaders ) ; }
Create a twig bridge loader.

@param \Psr\Container\ContainerInterface $container

@return \Twig\Loader\LoaderInterface
Create a twig bridge loader .