guys i want to get from database prestashop category info with module and i use sql query but if i try to assign foreach array prestashop retun me a error code : Parse error: syntax error, unexpected 'return' (T_RETURN)
This is my code
public function hookDisplayHome()
{
$getcategory = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'category_lang`');
$cattegoryinfo=array();
foreach($getcategory as $getcategoryinfo){
$cattegoryinfo[] = array(
"name" => $getcategoryinfo['name']
);
}
$this->context->smarty->assign('categories', $cattegoryinfo);
return $this->display(__FILE__,'views/showcategory.tpl');
}