Why in the template file variable's properties are get by dot (.) but added variables are get by arrow (->). In mainmenu.tpl I have:
public function renderWidget($hookName, array $configuration)
{
$this->smarty->assign([
'menu' => $this->getWidgetVariables($hookName, $configuration),
]);
// assign new variable
$id = 661;
$id_lang = $this->context->language->id;
$product = new Product((int) $id, false, (int) $id_lang);
$this->smarty->assign('product', $product);
return $this->fetch('module:ps_mainmenu/ps_mainmenu.tpl');
}
and in ps_mainmenu.tpl:
{$menu.label}
{$product->name}
{$product.name} //not render
How to acccess every property by dot?