You can reformat keys in an associative array according to Smart Compiler Regex'es rules.
$configS = array(); foreach($config as $key => $value) { $key = str_replace('.','_',$key); $configS[$key] = $value; } $smarty->assign('config', $configS);
OR
$configS = array(); foreach($config as $key => $value) $configS[str_replace('.','_',$key)] = $value; $smarty->assign('config', $configS);
Now you can use {$config.detailpage_var1} instead, just replace . on _ .
Walk through the array
function cleanKeysForSmarty(&item,$key) { return array(str_replace('.','_',$key) => $value); } $smarty->assign("config",array_walk_recursive($config,'cleanKeysForSmarty'));
Something like that.
source share