|
楼主 |
发表于 2010-3-24 13:28:17
|
显示全部楼层
function index(){
$data['content'] = $this->mcate->get_all_cate();
$this->load->view('cate/cate_show',$data);
$this->load->view('cate/cate_update',$data);
}
<?php foreach ($content as $res):?>
<li class="lis"><?php echo $res['cate_name'];?>
<a href="<?php echo site_url('cate/getcatebyid/'.$res['id']);?>">修改</a>
<a href="<?php echo site_url('cate/delete/'.$res['id']);?>">删除</a>
</li>
<?php endforeach;?>
</div>
<?php echo form_open('cate/add');?>
<li class="lis">上级分类:
<select name="parentid">
<option value="0">无(作为一级分类)</option>
<?php foreach ($content as $res):?>
<option value="<?php echo $res['id'];?>"><?php echo $res['cate_name'];?></option>
<?php endforeach;?>
</select>
</li>
<li class="lis">分类名:<input type="text" name="cate_name" /></li>
<li class="lis"><input type="submit" value="提交" /></li>
<?php echo form_close();?> |
|