Я добавил вкладку в свой модуль, мой модуль выглядит так:
class CustomerClub extends Module
{
public function __construct()
{
$this->name = 'customerclub';
$this->tab = 'pricing_promotion';
$this->version = '1.0.0';
$this->author = 'me';
$this->need_instance = 0;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
$this->controllers = array(
'AdminCustomerClub',
);
$this->bootstrap = true;
parent::__construct();
$this->tabs = array();
$this->tabs[] = array(
'class_name' => 'AdminCustomerClub',
'id_parent' => 0,
'name' => $this->l('custmer club'),
'visible' => true,
);
$this->displayName = $this->l('Customer Club');
$this->description = $this->l('Manage Customer Club ');
$this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
if (!Configuration::get('CUSTOMER_CLUB'))
$this->warning = $this->l('No name provided');
}
public function install()
{
if (Shop::isFeatureActive())
Shop::setContext(Shop::CONTEXT_ALL);
if (!parent::install() ||
!Configuration::updateValue('CUSTOMER_CLUB', 'customer club') ||
!$this->installModuleTab()
)
return false;
return true;
}
public function installModuleTab()
{
foreach ($this->tabs as $myTab) {
if (!Tab::getIdFromClassName($myTab['class_name'])) {
$tab = new Tab();
$tab->class_name = $myTab['class_name'];
$tab->module = $this->name;
if (isset($myTab['parent_class_name'])) {
$tab->id_parent = Tab::getIdFromClassName($myTab['parent_class_name']);
} else {
$tab->id_parent = 0;
// $tab->id_parent = -1;
}
$tab->name = array();
$languages = Language::getLanguages(ture);
foreach ($languages as $lang) {
$tab->name[$lang['id_lang']] = $myTab['name'];
}
$tab->add();
}
}
return true;
}
}
, и мой расширенный класс контроллеров для модуля администратора выглядит следующим образом: in: controllers / admin / AdminCustomerClubController.php
class AdminCustomerClubController extends ModuleAdminController
{
public function __construct()
{
$this->module = 'customerclub'; //refers to your module's $this->name = 'productarticle';
$this->bootstrap = true;
$this->context = Context::getContext();
parent::__construct();
}
public function init()
{
parent::init();
}
//
public function initContent()
{
parent::initContent();
$this->setTemplate('output.tpl');
}
}
и у меня также есть файл в: views / templates / admin / output.tpl
меню создается, но когда я нажимаю на него, оно показывает следующую ошибку:
Fatal error: Uncaught Error: Class 'AdminCustomerClubController' not found in /home/host/public_html/classes/controller/Controller.php:138 Stack trace: #0 /home/host/public_html/classes/Dispatcher.php(359): ControllerCore::getController('AdminCustom...') #1 /home/admin/public_html/admincp/index.php(58): DispatcherCore->dispatch() #2 {main} thrown in /home/host/public_html/classes/controller/Controller.php on line 138
Я удалил cache / class_index.php, и это не решает ошибку