Jump to content

[solved] I'm not able to call the configuration page of a modul from the backoffice menu


Recommended Posts

Hello developer,
I'm trying to understand the modul structure of Prestashop. That's why I created a module after this documentation.

Prestashop 1.7 documentation

Now I want to include the configuration page in the backoffice menu.  The inclusion of a link in the menu, I get out. I can not get the configuration page to show up when I click on the link. Can someone help me to learn this step?

With a code as an extension of the example module of the documentation for example?

regards

luca

 

 

Edited by Luca01
Konkretisierung (see edit history)
Link to comment
Share on other sites

Hi,

I got this code

<?php
class TestyTabsController extends ModuleAdminController
{ private $moduleName = 'testy';
  public function __construct()
    {
    parent::__construct();
    echo Module::getInstanceByName('testy')->getContent();
    }
}

for the admin controller. But it is out of the backoffice design.

:(

Link to comment
Share on other sites

Hi,

thankyou for reading. Here is a possible solution:

<?php
class TestyTabsController extends ModuleAdminController
{
  public function __construct()
    {
        $this->name = 'testy';
        $this->tab = 'front_office_features';
        parent::__construct();
        Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules', false)
            .'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name
            .'&token='.Tools::getAdminTokenLite('AdminModules'));
    }
}

regards

Link to comment
Share on other sites

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...