Smarty不显示多维数组[重复]

This question already has an answer here:

I have problem with displaying my array in smarty. It looks like this. Declaration of array:

index.php:

$rewrites = array(
'en' => array(
'homepage' => 'homepage'
),

'de' => array(
'homepage' => 'zuhause'
),
);

$smarty->assign('rewrites', $rewrites);

And in template file:

{$rewrites|@print_r}
{$rewrites[de][homepage]}

First line prints whole array like it is, so array is assigned. But second line shows nothing, why? How to do it properly? If I do it like this {$rewrites.de.homepage} it works but I really need to declare my array value like this {$rewrites[de][homepage]} because 'de' comes from other variable, that define current language. My target is {$rewrites[$lang][homepage]} for example.

</div>

Use:

{$rewrites[$lang]['homepage']}

You can use also:

{$rewrites.{$lang}.homepage}

you can do is as follows {$rewrites[$lang].homepage}

Simply try this:

{$rewrites.de.homepage}