MaRkiTuS_11 Posted January 29, 2014 Share Posted January 29, 2014 Hi, I'm not sure if it is a bug or not because I don't know if this is what you wanted to do or not, I think it is a bug because it doesn't make sense what you are supposed to do, maybe you could explain it to me. I will explain the situation. I've created a new custom module for Prestashop 1.6. I have created a new Controller which extends ModuleAdminController inside the proper folder of the module. This would be the structure. modules/userSubscription/controllers/admin/AdminUserSubscriptionController.php I can access to the controller through the proper URL in the admin area. Until here, all is ok. And now the problem/bug. In theory the template should be placed in this folder: modules/userSubscription/views/templates/admin/usersSubscriptionAdmin.tpl So that, in the initContent of the controller I've set the template ($this->setTemplate('userSubscription.tpl') But when I access to the controller in the admin, I have an error, and it tells that the template is not found because it is looking for it in themes/default/template/ This is the first line of the error: Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file '/home/****/domains/******.com/public_html/1b03d7a6fcacc82f3bb4d31689397850/admin-dev/themes/default/template/newfile.tpl' So that, if you move the file in the path it is looking for, all is working properly, but I think it shouldn't be like this, because all files should be in side the module. Thanks for your attention. Link to comment Share on other sites More sharing options...
PhpMadman Posted October 20, 2014 Share Posted October 20, 2014 I have the same issue. I can't get my template to load. I also tried createTemplate, It does not give an error, but the content is blank. not the page, page render with menus, toolbars, but where my template should be, it's empty. Link to comment Share on other sites More sharing options...
PhpMadman Posted October 25, 2014 Share Posted October 25, 2014 solved my problem public function initContent() { $page = $this->createTemplate('module.tpl'); $this->content = $page->fetch(); parent::initContent(); } tpl should be placed MODULE/views/templates/admin/CONTROLLER_NAME/module.tpl So not a bug, we just missplaced the file. And also I did not use the code correctyl until now. Link to comment Share on other sites More sharing options...
Recommended Posts