PHP SMRATY实例
author:一佰互联 2016-08-25   click:1174
PHP部分:$sql = "select * from notes  ORDER BY id DESC";$result = $db->query($sql);$notesItems = array();while($notesI=$db->fetch_array($result)){		  $notesI['Content'] = html_entity_decode($notesI['content']);	  $notesItems[] = $notesI;	  }$smarty->assign('NewsItems',$NewsItems);$smarty->assign('notesItems',$notesItems);$smarty->display('index.html');模板页:index.html{{section name=notesItem loop=$notesItems}}		                                               {{$notesItems[notesItem].content}}				{{/section}} 这部分执行正常然而其中{{$notesItems[notesItem].content}}是丛取出的MYSQL数据库代码内容	:{{section name=NewsItem loop=$NewsItems}}		{{$NewsItems[NewsItem].Title}}{{/section}} 却以文本代码形式出现,怎么让这部分从数据库里读取的section也能被以html执行					{{/section}}问题是怎么让
没说清楚。其中{{$notesItems[notesItem].content}}是从MYSQL数据库取出的代码形式的内容	:{{section name=NewsItem loop=$NewsItems}}{{$NewsItems[NewsItem].Title}}{{/section}} 怎么让这部分从数据库里读取的section代码也能被以html执行