2016-06-16 26 views
0

如何在PrestaShop的管理頁面(admin自定義模塊)的當前索引中添加新參數?如何在PrestaShop中爲當前索引添加新參數?

我嘗試以下,但它不工作:

$this->setcurrentindex=$this->setcurrentindex.'&view=querydrlog'; 

我需要的是:

http://localhost/raffleV1.3/oknr9hexztcseff5/index.php?controller=query&view=querydrlog&token=d81fcd49d179ae13444df0e8b2cccec6 

當我點擊asc或分頁部分USL是:

http://localhost/raffleV1.3/oknr9hexztcseff5/index.php?controller=query&kits_query_drOrderby=id_query_dr&kits_query_drOrderway=desc&token=d81fcd49d179ae13444df0e8b2cccec6 

對於上面的URL,我想添加'&view=querydrlog';,以便我的分頁和d asc將正常工作。

回答

2

您可以通過覆蓋AdminControllerinit()函數在模塊管理控制器中執行此操作。

class YourAdminModuleController extends ModuleAdminController { 
    protected $extra_params = '&view=querydrlog'; 

    public function init() { 
     parent::init(); 
     self::$currentIndex .= $this->extra_params; 
     $this->context->smarty->assign('current', self::$currentIndex); 
    } 
} 

這會將您的參數添加到排序鏈接hrefs或分頁表單操作鏈接。

相關問題