thinkphp的问题弄了半天了,还是不知道,各位大神帮忙看看吧
控制器中的代码:
public function testt(){
//$title=”练习册”;
//$content=’
‘.$_GET[‘name’];
//$this->assign(‘title’,$title);
$User = M(‘name’);
$list = $User->select();
$this->as来2源gaodaima#com搞(代@码&网sign(‘list’,$list);
$this->assign(“title”,”SMARTY测试”);
$this->display();
}
模板中的代码:
{$title}
{$vo.age}{$vo.name}
重要去掉foreach部分就正常,否则就会出显这样
syntax error, unexpected ‘)’, expecting T_VARIABLE or ‘$’ D:\AppServ\www\App\admin\Runtime\Cache\6e178638460c8ba2282739c247c2ce14.php 第 10 行.
cache文件中的代码为:
<body>
<?php echo ($title); ?>
<?php if(is_array($)): foreach($ as $key=>$): echo ($vo[“age”]); echo ($vo[“name”]); ?>
<?php endforeach; endif; ?>
看来好久也没有头绪,怎么办啊?