我在提交按钮时使用了下面的ajax函数,变量$list_ref包含正确的结果,如何分配这个变量以在tpl中使用它?有什么建议请
public function ajaxProcessSaveData(){
if(isset(Tools::getValue("ref_product"))){
$product_reference = Tools::getValue("ref_product");
$id_product = Tools::getValue('id_product');
$product_name= Tools::getValue('product_name');
$img_product = Tools::getValue('img_product');
$list_ref = array($id_product, $product_name, $img_product);
//var_dump( $list_ref);
$this->context->smarty->assign(array(
'list_refs' => $list_ref,
));
$this->context->smarty->assign('list_refs', $list_ref);
}
}
die($this->context->smarty->fetch(_PS_MODULE_DIR_.'MODULE name/views/templates/hook/abc.tpl'((