form
所有表单文本框创建可以使用静态类form组件,例如:
/**
* jquery.uploadify 上传图片
* @param $id ID
* @param $upload_type 上传类型 images
* @return html
*/
static public function uploadfile($id = 'uploadify', $upload_type = 'images');
使用方法:
form::uploadfile($filed_data['name'], 'files');
/**
* 在线编辑器
* @param $name 编辑器名称
* @param $default_value 编辑默认信息 例如修改
* @param $width width
* @param $height height
* @param $id id
* @return
*/
static public function editer($name, $defult_value='', $width="600", $height="300", $id = '')
使用方法:
form::editer("data[{$filed_data['name']}]", '', $width, $height, $filed_data['name']);
/**
* 时间日期 年月日 时分秒
* 日历 访问地址:http://www.my97.net/dp/demo/index.htm 方便日后修改查找,哈哈哈哈哈
* @param $name
* @param $def_value 输入框默认值
* @param $dateFmt 格式化日期
* @param $js_event JS事件
* @return
*/
static public function datetime($name, $def_value = '', $dateFmt = 'yyyy-MM-dd', $js_event = 'onfocus')
使用方法:
form::datetime("data[{$filed_data['name']}]");
/**
* input
* @param $name
* @param $value 文本框value
* @param $type 文本框type
* @param $class input class
* @param $id id
* @param $style style
* @return text html
*/
static public function input($name, $value = '', $type = 'text', $class = 'text w_15', $id = '', $style='')
使用方法:
form::input("data[{$filed_data['name']}]", $this->update_infos);
/**
* <{echo form::radio('is_display', '1', '1')}>
* @param $name
* @param $value value 传递数组 array('选项值' => '选项名称')
* @param $checked_value checked key
* @return radio html
*/
static public function radio($name, $value = '', $checked_value = '')
使用方法:
form::radio();
/**
* <{echo form::checkbox('is_display', '1', '1')}>
* @param $name
* @param $value value 传递数组过来 array('选项值' => '选项名称')
* @param $checked checked key
* @return radio html
*/
static public function checkbox($name, $value = '', $checked_value = '')
使用方法:
form::checkbox();
/**
* textarea
* @param $name 名称
* @param $value value
* @param $rows rows
* @param $cols cols
* @param $class classname
* @param $style style
*/
static public function textarea($name, $value='', $rows=10, $cols=50, $class = '', $style='')
使用方法:
form::textarea("data[{$filed_data['name']}]", '', '', '', '', "width:{$width};height:{$height}");
/**
* <{echo form::select('select123', $select, '1')}>
* @param $name
* @param $data array
* @param $selected_key 默认选中KEY
* @param $first_option 第一个OPTIONS
* @param $class css classname
* @param $onevent js event[change, click, mouseover, mouseout ...]
* @param $style style
* @return select html
*/
static public function select($name, $data,$selected_key = '', $first_option = '', $class = 'small-input', $onevent = '', $style = '')
使用方法:
form::select();