Jump to content

Admin controller not found


Recommended Posts

Hi,

I'm using Prestashop 1.6. For my custom module I need to add a new tab but I can't seem to make it work.

The tab is displayed correctly the only issue is when I click on the link it tells me the controller is not found.

I've read countless forum posts and open source code on github to try and find out why this is not working. My code seems to be pretty similar to other modules though...

Here is my test admin controller:

<?php
class AdminJournalCustomizationController extends ModuleAdminController
{
    public function __construct()
    {
        parent::__construct();
        $this->bootstrap = true;
        $this->id_lang = $this->context->language->id;
        $this->default_form_language = $this->context->language->id;
    }

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

And how I declare my tab:

    public function installTab()
    {
        $tab = new Tab();
        $tab->active = 1;
        $tab->class_name = 'AdminJournalCustomization';
        $tab->name = array();
        foreach (Language::getLanguages(true) as $lang) {
            $tab->name[$lang['id_lang']] = 'Journal Customization';
        }
        $tab->id_parent = 0;
        $tab->module = $this->name;
        return $tab->add();
    }

Thanks

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...