Jump to content

Edit History

PietroSAIinformatica

PietroSAIinformatica


Miss wrote the code in the tpl file part

Hi, this is my first time creating a module for prestashop and i'm stuck with sending a php variable to the tpl file.

I'm using smarty for sending that variable but when i upload the module nothing get diplyed:

What i did wrong? You have an idea?

Thanks for your time and helps;

my regards.

Here i wrote down the code of it.

In php file:

public function test($params){

    $smarty= new smarty();

    $test='<h1>TEST</h1>';

    $smarty->assign('TS',$test);

    $smarty->display('newmod.tpl');

}

In tpl file:

<div id="mymodule_block_home" class="block">
  <div class="block_content">    
    <div>
        {$TS}
    </div>
  </div>    
</div>

PietroSAIinformatica

PietroSAIinformatica

Hi, this is my first time creating a module for prestashop and i'm stuck with sending a php variable to the tpl file.

I'm using smarty for sending that variable but when i upload the module nothing get diplyed:

What i did wrong? You have an idea?

Thanks for your time and helps;

my regards.

Here i wrote down the code of it.

In php file:

public function test($params){

    $smarty= new smarty();

    $test='<h1>TEST</h1>';

    $smarty->assign('TS',$test);

    $smarty->display('newmod.tpl');

}

In tpl file:

<div id="mymodule_block_home" class="block">
  <div class="block_content">    
    <div>
        {$test}
    </div>
  </div>    
</div>

×
×
  • Create New...