【发布时间】:2014-03-13 13:37:41
【问题描述】:
我想对 PHP 上的 mysql 表中的变量使用 smarty 循环
{section name=row loop=$userCoursesList}
<h1> {lang('profile.{$userCoursesList[row].course_name}')} </h1>
{/section}
例如,输出应该是:
{lang('profile.english}')}
{lang('profile.french}')}
{lang('profile.business}')}
但可能我没有使用正确的语法,因为如果我只写
{$userCoursesList[row].course_name}
SQL 语句正在运行并给我(英语、法语、商务)
如果我只是写:
{lang('profile.english}')}
这也有效,并从我的 .php 语言文件中为我提供了“英语语言课程”
我不知道怎么回事,如果有人可以帮助我,在此先感谢
【问题讨论】:
标签: php mysql codeigniter internationalization smarty