I do not understand how to assign the correct name here with Smarty.
If I try to do so it does not get recognized:
$smarty->assign('lang[\'city\']', $lang['city']);
It does not assign anything...
Can you help me out?
$lang is an associative array, like $lang = array('city'=>'Here', 'name'=>'Steve');
According to smarty documentation you should use:
$smarty->assign( 'lang', $lang);
And in template:
{$lang.city}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.