thinkphp volist标签 解析之后 if(is_array($)) 为什么里面没有值? 10
//自动生成classIndexActionextendsAction{publicfunctionindex(){$db=newModel('user');$selec...
//自动生成
class IndexAction extends Action {
public function index(){
$db = new Model('user');
$select = $db->select();
dump($select);
$this->assign('select',$select);
$this->display();
}
}
//模板
<volist name="select" id="vo">
<$vo.id>
<$vo.user>
</volist>
//解析报错
<?php if(is_array($)): $i = 0; $__LIST__ = $;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$): $mod = ($i % 2 );++$i;?><$vo.id>
<$vo.user><?php endforeach; endif; else: echo "" ;endif; ?> 展开
class IndexAction extends Action {
public function index(){
$db = new Model('user');
$select = $db->select();
dump($select);
$this->assign('select',$select);
$this->display();
}
}
//模板
<volist name="select" id="vo">
<$vo.id>
<$vo.user>
</volist>
//解析报错
<?php if(is_array($)): $i = 0; $__LIST__ = $;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$): $mod = ($i % 2 );++$i;?><$vo.id>
<$vo.user><?php endforeach; endif; else: echo "" ;endif; ?> 展开
2013-11-28
展开全部
确定数据库无误的情况下参照:
<?php
Class IndexAction extends Action{
public function index(){
$data=D("user");
$list=$data->select();
$this->assign('list',$list);
$this->display();
}
}
?>
<?php
Class IndexAction extends Action{
public function index(){
$data=D("user");
$list=$data->select();
$this->assign('list',$list);
$this->display();
}
}
?>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询