class <my_module><controller>FrontController extends ModuleFrontController
The route to this will be like <my_prestashop_host>/index.php?fc=module&module=<my_module>&controller=<controller
Also to create the back-office admin controller for you module create a file in /modules/<my_module>/controllers/admin/<controller>.php. The class definition should be:
class <controller>Controller extends ModuleAdminControllerThe route to this should look like <my_prestashop_host>/<admin_dir>/index.php?controller=<controllerThe most important part of the admin controller is Tab configuration. Make sure, in the install procedure of the module you register a tab something like this:
$tab = new Tab();
$tab->active = 1;
$tab->name = array();
$tab->class_name = '<controller>';
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = '<my controller description text>';
}
$tab->id_parent = -1;
$tab->module = <my_module>;
$tab->add();
Make sure the record is there in ps_tab table.
Prestashop Themes Wordpress themes
No comments:
Post a Comment