|
本帖最后由 smallhe 于 2013-4-2 17:30 编辑
在控制器端:
foreach ($res as $item) {
$data[$item['type']][] = $item;
}
$this->load->view('home/index',$data);
在模板里面:
<?php foreach ($data as $item):?>
<?php echo $item['name'];?>
<?php endforeach;?>
提示出错:
Severity: Warning Message: Invalid argument supplied for foreach()
Filename: home/index.php
|
|