public function edit(){
$Article=D('Article');
$Article=$Article->find(I('id'));
$this-> ;assign('Articler',$Articler);
if(IS_POST){
$date['id']=I('id');
$date['title']=I( 'title');
$date['desc']=I('desc'); ## out out can be ']!=''){
$ upload->exts =array('jpg', 'gif', 'png', 'jpeg'); // Set attachment upload type
$upload->rootPath ='./'; // Set attachment Upload root directory
‐ ‐ ’ ’ s ’ s s t t ’ s to be uploaded $upload->savePath ='./Uploads/'; ;
{//Upload successful
$date['pic']=$info['savepath'].$info['savename'];
}
}else{
}
if($Article->create($date)){
if($Article->save()){
$this->success("修改文章成功!",U('lst'),3);
}else{
$this->error('修改文章失败!','',3);
}
}else{
$this->error($Article->getError());
}
return;
}
$cateres=D('cate')->select();
$this->assign('cateres',$cateres);
$this->display();
}
<tr>
<th><i class="require-red">*</i>缩略图:</th>
<td>
<if condition="$Articler['pic'] neq ''">
<img src="__ROOT__{$Articler.pic}" height="50">
<else/>
无缩略图
</if>
<input id="pic" name="pic" size="50" value="{$Articler.pic}" type="file">
</td>
</tr>