# 生成表单
###变量声明
~~~
private $meta_title;
private $post_url;
private $form_items = array();
private $form_data = array();
private $extra_html;
private $is_ajax = true;
private $set_coulmn;//设置分栏 默认为一栏
private $template;
~~~
### 模板初始化
~~~
protected function _initialize(){
$this->template =APP_PATH.'JankzMaker/View/Admin/jankzform.html';
}
~~~
### 设置页面标题
~~~
public function setMetaTitle($meta_title){
$this->meta_title = $meta_title;
return $this;
}
~~~
### 设置页面提交地址
~~~
public function setUrl($post_url){
$this->post_url = $post_url;
return $this;
}
~~~
###设置表单分列
~~~
public function setCoulmn($set_coulmn = 1){
$this->set_coulmn =$set_coulmn;
return $this;
}
~~~
### 设置ajax提交
~~~
public function setAjax($is_ajax){
$this->is_ajax = $is_ajax;
return $this;
}
~~~
### 设置表单元素
~~~
public function addFormItem($name,$type,$title,$value,$coulmn=1,$options=array()){
$item['name']=$name;
$item['type']=$type;
$item['title']=$title;
$item['value']=$value;
$item['options']=$options;
$item['coulmn']=$coulmn;
$this->form_items[] = $item;
return $this;
}
~~~
### 设置表单模板
~~~
public function setTemplate($template){
$this->template = $template;
return $this;
}
~~~
### 打印表单
~~~
public function display(){
$this->assign('meta_title',$this->meta_title);
$this->assign('post_url',$this->post_url);
$this->assign('form_data',$this->form_data);
$this->assign('form_items',$this->form_items);
$this->assign('set_coulmn',$this->set_coulmn);
$this->assign('is_ajax',$this->is_ajax);
parent::display($this->template);
}
~~~
- 序言
- 基础
- 简介
- 获得Jzopen
- 安装
- 配置
- 系统默认配置参考
- 新增配置项
- 数据库
- 预览
- Auth认证
- Session
- User
- Menu
- Manager
- Group
- Role
- 系统结构
- jankzMaker
- V1.0
- MakerTable
- MakerForm
- v1.1
- FormMaker
- 重装系统
- jankzForm
- jankzform-v1.0
- jankzform.html
- jankzform-v1.1
- jankzTable
- jankztable-v1.0
- jankztable.html
- jankzPage
- jankzpage-v1.0
- jankzpage.html
- elementary
- form
- text
- password
- select
- radio
- checkbox
- btn
- btns
- textarea
- hidden
- image
- editor
- toggle
- label
- labels
- rating
- slider
- sliders
- divider
- icon-divider
- pages
- table
- 二次开发
- jzopen后台
- 精简系统
- 插件开发
- 官方插件
- 第三方插件
- 独有专享插件
- 户主开发插件
- 云商店
- 云商店下载插件
- 插件上传
- 在线升级
- 检查升级
- 升级常见问题
- 部署
- 推荐配置
- 阿里云ECS部署
- 新浪Sae部署