Edit fungsi awam(){
$Article=D('Article');
$Article=$Article->find(I('id'));
$this->assign('Article',$ Articler); I('desc'); ['Cateid'] = i ('Cateid'); muat naik Think baharu (); // $upload->maxSize =3145728 ;//Tetapkan saiz muat naik lampiran
upload->rootPath ='./'; // Tetapkan direktori akar untuk memuat naik lampiran
$upload-> ; uploadone ($ _ fail ['pic']); $date['pic']=$info['savepath'].$info['savename'];
}
} if($Article->create($date)){
jika ($ artikel- & gt; save ()) {
$ this- & gt; kejayaan ("修改 文章 成功!", u ('lst'), 3);
} else {
$ this- & gt; error ('修改文章失败!','',3);
}
}lain{
($this->error->er-> }
kembali;
}
$cateres=D( 'cate')->select();
$this->assign('cateres',$cateres);
$this->display();
}
<tr>
<th><i class="require-red">*</i>缩略图:< <td>
<if condition="$Articler ['pic'] neq ''">
<img src="__ROOT__{$Article.pic}" height="50"> lt;else/>
无缩略图
<input id="pic" name="pic" size="50" value="{$Article.pic}" type="file">
; ;
</tr>