Nico Ratti Posted March 9, 2016 Share Posted March 9, 2016 Hi, I have some issues adding a new tab in the backoffice menu. I successfully created it with this: public function insertMenuTab() { $tab = new Tab(); //$tab->name = 'Gestione Preventivi'; $tab->module = $this->name; $tab->class_name = 'AdminQuote'; $tab->id_parent = 0; // Root tab foreach (Language::getLanguages() as $l) $tab->name[$l['id_lang']] = 'Gestione Preventivi'; $tab->save(); return true; } But now I don't know how to show a view. I put the class AdminQuoteController in <module_root>/controllers/admin/AdminQuote.php and it just extends ModuleAdminControllerCore. What should I do now to show a view? I didn't find anything in the prestashop docs! Link to comment Share on other sites More sharing options...
Nico Ratti Posted March 10, 2016 Author Share Posted March 10, 2016 Finally, I find this way: I created the class AdminQuoteController in /controllers/admin/AdminQuote.php that extends ModuleAdminController. With this code inside: class AdminQuoteController extends ModuleAdminController { public function renderList() { return $this->context->smarty->fetch(_PS_MODULE_DIR_.'preventivi/views/templates/admin/content.tpl'); } } This works even without any display(), init(), initContent() or __construct() as I read in other previous threads. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now