Jump to content

module->display not working


Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...