admin管理员组文章数量:1279117
I created a form and I want to handle the hook hookDisplayAdminProductsMainStepLeftColumnMiddle directly from the controller in /controllers/admin/AjaxSeoScore.php. The view to be displayed is located in /views/templates/admin/test.tpl
public function hookDisplayAdminProductsMainStepLeftColumnMiddle($params)
{
$controller = new AdminAjaxSeoScore();
return $controller->display();
}
and then my controller
class AdminAjaxSeoScore extends ModuleAdminController
{
public function __construct()
{
// Chiamata al costruttore della classe base
parent::__construct();
// Setta il template per la visualizzazione
$this->template = 'seoscore_header.tpl';
}
// Funzione per la visualizzazione dell'hook
public function display()
{
// Aggiungi variabili da passare al template se necessario
$this->context->smarty->assign(array(
'some_variable' => 'Some value', // Esempio di variabile da assegnare
));
// Visualizza il template
parent::display();
}
}
Is this the correct way to work? I can't visualize anything. How do I pass for example the product id to the controller?
本文标签: javascriptPrestashop Controllers and HooksStack Overflow
版权声明:本文标题:javascript - Prestashop Controllers and Hooks - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741261611a2367726.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论