rickczsu Posted August 8, 2015 Share Posted August 8, 2015 (edited) Hi. Maybe easy solution but I spent 10 hours finding it. I made module. In my module I made controller in mymodule/controllers/admin folder. I installed module and it works, but I can´t figure out how to show my template. My code is class showmeController extends ModuleAdminController { public function __construct() { parent::__construct(); } public function initContent() { return $this->display('display.tpl'); } } }When I use initContent, everything faults. When I use getContent I see the title of my controller, but nothing else. Any help? Please....Tpl file is located in modulefolder/views/templates/admin Edited August 9, 2015 by rickczsu (see edit history) Link to comment Share on other sites More sharing options...
Mohamadou Ndiaye Posted August 9, 2015 Share Posted August 9, 2015 Hi try this public function initContent() { parent::initContent(); } public function renderList() { return $this->module->display(_PS_MODULE_DIR_.'Your module name', 'views/templates/admin/your template.tpl');} 1 1 Link to comment Share on other sites More sharing options...
Mohamadou Ndiaye Posted August 9, 2015 Share Posted August 9, 2015 You can use the same technique if you wanna also change the template on renderView() , renderForm() :-) Link to comment Share on other sites More sharing options...
rickczsu Posted August 9, 2015 Author Share Posted August 9, 2015 BIG THANK YOU :-). You saved me a lot of time. Topic solved Link to comment Share on other sites More sharing options...
Mohamadou Ndiaye Posted August 9, 2015 Share Posted August 9, 2015 Good news. Enjoy :-) 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