Prestashop : what's the difference between fetch and display in Module

Viewed 246

I wonder what is the difference between this two methods in a Module Class : fetch and display. Looking at the source code of different modules I see fetch with renderWidget and display with traditionnal hooks.

class MyModule extends Module {

    //...

    public function hookdisplayTopColumn($params)
    {
        $this->context->smarty->assign(array(
            'foo' => 'bar',
        ));

            return $this->display(__FILE__, 'html.tpl');
    }

    //...

    public function renderWidget($hookName, array $configuration) {
        if (!$this->isCached($this->templateFile, $this->getCacheId('blockreassurance'))) {
            $this->context->smarty->assign($this->getWidgetVariables($hookName, $configuration));
        }

        return $this->fetch($this->templateFile, $this->getCacheId('blockreassurance'));
    }
}

thank you and good evening !!

0 Answers
Related