如何在prestashop Back office中插入管理选项卡?

如何在prestashop Back office中插入管理选项卡?,prestashop,Prestashop,我想在BO中插入一个新选项卡,我创建了该选项卡及其控制器,但出现错误“未找到控制器”这是我的代码: public function installTab($class_name, $name) { $tab = new Tab(); // Define the title of your tab that will be displayed in BO $tab->name[$this->context->language->id] = $n

我想在BO中插入一个新选项卡,我创建了该选项卡及其控制器,但出现错误“未找到控制器”这是我的代码:

  public function installTab($class_name, $name)  {
    $tab = new Tab();
    // Define the title of your tab that will be displayed in BO
    $tab->name[$this->context->language->id] = $name; 
    // Name of your admin controller 
    $tab->class_name = $class_name;
    // Id of the controller where the tab will be attached
    // If you want to attach it to the root, it will be id 0 (I'll explain it below)
    $tab->id_parent = 0;
    $tab->active = 1;
    // Name of your module, if you're not working in a module, just ignore it, it will be set to null in DB
    $tab->module = $this->name;
    // Other field like the position will be set to the last, if you want to put it to the top you'll have to modify the position fields directly in your DB
    return $tab->add();
}

还有我的控制器

class AdminBarCodeGeneratorController extends ModuleAdminController{

public function __construct(){
    parent::__construct();
}

public function display(){
$smarty = $this->context->smarty;
$scan_form=$this->renderForm();
$smarty->assign('scan_form',$scan_form);
 return $this->display(__FILE__, 'views/templates/admin/tabs/scan.tpl');
 }
}

我的控制器类位于controllers/admin/AdminBarCodeGeneratorController.php路径下

您可以在此存储库中找到答案


请将您的控制器文件名更改为“AdminBarCodeGenerator.php”。

我尝试过,但没有找到相同的错误控制器
class AdminBarCodeGeneratorController extends ModuleAdminController{

public function __construct(){
    parent::__construct();
}

public function display(){
$smarty = $this->context->smarty;
$scan_form=$this->renderForm();
$smarty->assign('scan_form',$scan_form);
 return $this->display(__FILE__, 'views/templates/admin/tabs/scan.tpl');
 }
}