OxCom / zf3-twig

ZendTwig is a module that integrates the Twig template engine with Laminas.
MIT License
19 stars 6 forks source link

Re-implement getHelperPluginManager in TwigRenderer ? #3

Closed Ppito closed 7 years ago

Ppito commented 7 years ago

Hello,

I'm working on a ZF3 module of sass compiler, and I need to call the method getHelperPluginManager that implemented in PhpRenderer, but this method has been rename on getZendHelpers in your TwigRenderer.

Actually, I need to test the type of renderer for call the good method, but it will be simplest not to do this.

    public function prepareStyle(ViewEvent $e) {
        /** @var \Zend\View\Renderer\PhpRenderer|\ZendTwig\Renderer\TwigRenderer $renderer */
        $renderer = $e->getRenderer();
        if ($renderer instanceof \ZendTwig\Renderer\TwigRenderer) {
            $pluginManager = $renderer->getZendHelpers();
        } else {
            $pluginManager = $renderer->getHelperPluginManager();
        }
        $containerHeadLink = $pluginManager->get('headLink')->getContainer();
        // ...
    }

So is it possible to re-implement this method in TwigRenderer ?

OxCom commented 7 years ago

That's good point. Updated in master/dev branches. Changes will be available in next release

OxCom commented 7 years ago

New changes are available in release v0.1.1

Ppito commented 7 years ago

thx a lot, I will test it soon ;)

Ppito commented 7 years ago

All work's fine :D thx for your great jobs ;)