什么是context-> smarty->在prestashop中分配什么是钩子

时间:2013-05-13 11:46:52

标签: smarty prestashop

In indexController I have this

public function initContent()
    {
        //echo"asdsad";exit;
        parent::initContent();
        $this->context->smarty->assign('HOOK_HOME1', Hook::exec('displayHome'));
        $this->setTemplate(_PS_THEME_DIR_.'index.tpl');
    }

但我不明白。什么是$this->context->smarty->assign,什么是Hook

1 个答案:

答案 0 :(得分:3)

assign公开可以在smarty模板中使用的变量。 Hook::exec('displayHome')执行名为displayHome的挂钩,然后将结果分配给名为HOOK_HOME1的变量。

看看Smarty documentation。还有一个prestashop挂钩列表here