一般的公共类(form.class.php)都是放在classes文件夹下,但要在public下放一些依赖文件。
在index类的add函数里:
add(){
$this->assign("ck",Form::editor("content","full",200,"yellow"));//对应下面$ck
$this->assign("starttime",Form::date("time["starttime"],'' ,1));//1 0是否显示日期 对应下面$starttim
$this->assign("endtime",Form::date("time["endtime"],'' ,0));//对应下面的$endtime
$this->assign("color",Form::color("color","$ff00"));//对应下面的$color
}
在add模板中:
<textarea cols="50" rows="8" name="content"></textarea>
<{$ck}> //显示带有编辑选项的编辑栏
<{$starttime}> //显示选择日期的框
<{$endtime}>
<{$color}> //添加颜色选择器