I'm developing a simple module, but I'm unable to successfully make the admin controller work.
This is the directory structure for my module:

And this is the AdminPaymentsController.php file:
<?php
class AdminPaymentsController extends ModuleAdminController {
}
I created a tab on my module installation using this function:
public function installTab($parent, $class_name, $name) {
$tab = new Tab();
$tab->id_parent = (int)Tab::getIdFromClassName($parent);
$tab->name = array();
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = $name;
}
$tab->class_name = $class_name;
$this->module = $this->name;
$tab->active = 1;
return $tab->add();
}
And calling it like this:
if (!$this->installTab('AdminCatalog', 'AdminPayments', 'Payments Management')) return false;
The tab seems to be installed correctly:

But when I open it, it show an error message:

http://dev.prestashop.com/admin123asdf/index.php?controller=AdminPayments&token=52dbfa9a1a6c3935fd3cbb1276bcbedb
Why is this happening? How can I debug this?
Your controller file name should be AdminPayments.php.
And change this line: $this->module = $this->name; for this one: $tab->module = $this->name;
Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With