zendframework / zend-expressive-twigrenderer

Twig integration for Expressive
BSD 3-Clause "New" or "Revised" License
25 stars 14 forks source link

feat(TwigRenderer): Expose the TwigFilesystem prependPath method #48

Closed jakeBarwell closed 6 years ago

jakeBarwell commented 6 years ago

The TwigRenderer exposes the addPath method of the TwigFilesytem but users may need to addPaths with higher priority than those already loaded by using prependPath. This pull requests simply exposes that function replicating the addPath wrapper.

geerteltink commented 6 years ago

I'm not a fan of adding extra methods which are not described in the interface. Especially when something is already possible (I haven't tested it though):

        $twigEnvironment = $container->get(Twig_Environment::class);
        /** @var FilesystemLoader $loader */
        $loader = $twigEnvironment->getLoader();
        $loader->prependPath('test');
jakeBarwell commented 6 years ago

Fair point, I did forget to check the interface and that method does work so it's not critical to add this :+1: