问答详情
源自:6-3 Smarty的偱环语句

为什么我写的section循环运行不显示呢

 $articlelist = array(
  array(
   "title" => "第一篇文章",
   "author" => "小王",
   "content" => "又写了一篇不知所云的文章"
  ),
  
  array(
   "title" => "第二篇文章",
   "author" => "小李",
   "content" => "又写了一篇不知所云的文章"
  )
 );
 $smarty->assign("articlelist",$articleList);


{section name=article loop=$articlelist}
  {$articlelist[article].title}
  {$articlelist[article].author}
  {$articlelist[article].content}
<br/>
{/section}

提问者:夜雨星缘 2017-04-26 18:02

个回答

  • 镜像__梦ing
    2017-09-21 15:49:23

    开发考验细心

  • 夜雨星缘
    2017-04-26 18:08:45

    额, $smarty->assign("articlelist",$articleList);  l写成大写的了