Jump to content

Edit History

Chariel

Chariel


Updated the code

1 hour ago, endriu107 said:

You need to pass data to smarty.

Check in other modules there is something like: $this->context->smarty->assign()

Hello and thank you!

I changed my controller file like this:

$id_customer=(int)$this->context->customer->id;
$caed = CassyTestModel::getCaedData($id_customer);
//var_dump($caed);
$this->context->smarty->assign([
'caed' => $caed,
]);
return $this->setTemplate('module:myFirstModule/views/front/c-module.tpl');

and it seems working if on DB I have a text or integer value. As I need to display a date i got empty value on .tpl files and on var_dump a bool(false) results. The db value is a simple date like 2021-10-04 00:00:00 that I want to display like D - M - Y 00:00 

 

Thank you!

Chariel

Chariel

59 minutes ago, endriu107 said:

You need to pass data to smarty.

Check in other modules there is something like: $this->context->smarty->assign()

Hello and thank you!

 I need to pass values inside my function, right?

Like 

$this->context->smarty->assign($caed = CassyTestModel::getCedData($id_customer));

 

Chariel

Chariel

36 minutes ago, endriu107 said:

You need to pass data to smarty.

Check in other modules there is something like: $this->context->smarty->assign()

Hello and thank you!

 I need to pass values inside my function, right?

Like 

$this->context->smarty->assign('to' -> $to)

 

×
×
  • Create New...