微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

PHP自动生成表单代码分享

Form.PHP

rush:PHP;"> action=$action; $this->method=$method; } function form_start(){ $text="
action}\" method=\"{$this->method}\""; if($this->class!==""){ $text.=" class=\"{$this->class}\""; } if ($this->enctype!=="") { $text.=" enctype=\"{$this->enctype}\""; } if($this->id!==""){ $text.=" id=\"{$this->id}\""; } if($this->name!==""){ $text.=" name=\"{$this->name}\""; } $text.=">\n"; if($this->layout==true){ $text.="layout==true) { $text="\t函数 function form_text($name,$id,$label_name,$label_for,$value=""){ $text="form_label($label_name,$label_for); $form_item=$this->form_item($label,$text); return $form_item; } //密码框函数 function form_passwd($name,$value=""){ $text="form_label($label_name,$text); return $form_item; } //隐藏域函数 function form_hidden($name,$value=""){ $text="form_label($label_name,$text); return $form_item; } //文件函数 function form_file($name,$size=""){ $text="form_label($label_name,$text); return $form_item; } //复选框函数 function form_checkBox($name,$label=array(),$label_for=""){ $i=0; $text=array(); foreach ($label as $id=>$value){ $text[$i]=""; $text[$i].="