islem98 Posted August 31, 2019 Share Posted August 31, 2019 hi; im developping prestashop module on my amincontroller im using this renderView public function renderView() { $id=Tools::getValue('id'); $this->adminlog=new AdminLogModel($id); $class_name=$this->adminlog->nom; self::__autoload($class_name); $old_value=json_decode($this->adminlog->old_value, true); if (!empty($this->adminlog->new_value)) { $new_value=json_decode($this->adminlog->new_value, true); $this->context->smarty->assign(array( 'old_value'=>$this->renderDetailsData($this->adminlog->nom, $old_value), 'new_value'=>$this->renderDetailsData($this->adminlog->nom, $new_value) )); } else { $this->context->smarty->assign(array( 'old_value'=>$this->renderDetailsData($this->adminlog->nom, $old_value) )); } $file = _PS_MODULE_DIR_ . 'adminlog/adminlog.php'; return $this->module->display($file, 'views/templates/admin/detail.tpl'); } my detail.tpl in the right path but its sowing this error Unable to load template 'file:views/templates/admin/detail.tpl' im using ps 1.7.5.2 ps: it was working succesfully with this code can any one help please Link to comment Share on other sites More sharing options...
Rolige Posted September 2, 2019 Share Posted September 2, 2019 Hello: Here an example from \modules\dashgoals\controllers\admin\AdminDashgoalsController.php: $this->module->display(_PS_MODULE_DIR_.$this->module->name.DIRECTORY_SEPARATOR.$this->module->name.'.php', 'config.tpl') But you can use too this smarty function: $this->context->smarty->fetch('MODULE_PATH/views/templates/admin/configure.tpl'); Regards Link to comment Share on other sites More sharing options...
islem98 Posted September 2, 2019 Author Share Posted September 2, 2019 hi rolige, thank you it worked, i think it was the problem of windows accessibility that the function couldnt access to the .tpl file 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