【发布时间】:2017-02-02 08:14:33
【问题描述】:
您好,我正在为 PrestaShop 1.6 开发新的支付插件。我通过 HelpList 类创建了列出我的插件发出的所有付款请求的功能。有没有办法添加自定义按钮操作和操作 mu 列表中的每一行?我搜索没有成功的解决方案。
感谢您的帮助!干杯!
这是我的管理控制器类。
class AdminNameModuleController extends ModuleAdminController {
public function __construct()
{
// Call of the parent constructor method
parent::__construct();
// Add actions
//$this->addRowAction('view');
//$this->addRowAction('delete');
$this->addRowAction('test');
}
public function initToolbar()
{
$this->toolbar_btn = array();
}
public function processTest()
{
// Do your button processing here
}
public function displayTestLink($token = null, $id, $name = null)
{
$tpl = $this->createTemplate('helpers/list/list_action_test.tpl');
$tpl->assign(array(
'href' => self::$currentIndex.'&token='.$this->token.'&
'.$this->identifier.'='.$id.'&test'.$this->table.'=1',
'action' => $this->l('Test')
));
return $tpl->fetch();
}
public function initProcess()
{
parent::initProcess();
if (Tools::getValue('test'.$this->table))
{
$this->display = 'test';
$this->action = 'test';
}
}
}
【问题讨论】: