Tpl direct print html in prestashop? -


i craete custom module add textarea in product backoffice . when print textarea in tpl file in print direct html link

enter image description here

i use print in tpl

 {if isset($belvg_textarea)}     <div>      {$belvg_textarea|unescape:'html'}      {$belvg_textarea|escape:'html'}     </div>  {/if} 

and in module php file display

 public function hookdisplayfooterproduct($params) {     $id_product = tools::getvalue('id_product');     $sampleobj = belvg_sample::loadbyidproduct($id_product);     if(!empty($sampleobj) && isset($sampleobj->id)){         $this->context->smarty->assign(array(             'belvg_textarea' => $sampleobj->textarea,         ));     }      return $this->display(__file__, 'views/frontend/sample.tpl'); } 

you should use nofilter beacause prestashop 1.7 escape html default html tags displayed

in tpl file :

{if isset($belvg_textarea)}     <div>      {$belvg_textarea nofilter}     </div>  {/if} 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -