'启用', 2 => '失效', ); # 定义图片选择器的内容 key为id,value为显示的样式 $template = array ( 1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '', 7 => '', 8 => '', ); return array ( # 表名 'name' => 'config', # 显示给用户看的名称 'lang' => '后台个性化', 'order' => 10, # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => '配置ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'search' => 'order', 'list' => true, ), 'name' => array ( 'type' => 'varchar-32', 'name' => '配置名', 'default' => '', 'desc' => '请输入配置名', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'template' => array ( 'type' => 'int-1', 'name' => '后台模板', 'default' => '1', 'desc' => '请选择后台模板', 'match' => 'is_numeric', 'option' => $template, 'update' => 'selector',//图片选择器 注意跟select/radio不同哦 ), 'title' => array ( 'type' => 'varchar-32', 'name' => '后台title', 'default' => '', 'desc' => '请输入后台title', 'match' => 'option', 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'info' => array ( 'type' => 'varchar-40', 'name' => '控制台欢迎标题', 'default' => '', 'desc' => '请输入控制台欢迎标题', 'match' => 'option', 'update' => 'text', ), 'content' => array ( 'type' => 'text-255', 'name' => '控制台欢迎内容', 'default' => '', 'desc' => '请输入控制台欢迎内容', 'match' => 'option', 'update' => 'editor', //'strip' => false,//默认是开启strip_tags过滤的,这里可以加上这个来取消过滤 ), 'state' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '请选择状态', 'match' => 'is_numeric', 'option' => $option, 'update' => 'radio', 'list' => true, ), 'cdate' => array ( 'type' => 'int-11', 'name' => '录入时间', 'match' => array('is_numeric', time()), 'desc' => '', # 只有insert时才生效 'insert' => true, 'list' => 'date("Y-m-d H:i:s", {cdate})', ), ), # 更新表结构 'alter' => array ( 1 => array ( array('add', 'info', 'info', 'varchar-40 控制台欢迎标题'), array('add', 'content', 'content', 'text-255 控制台欢迎内容'), ), 2 => array ( array('add', 'template', 'template', 'int-1 1 模板'), ), 'version' => 2, ), # 默认值 'default' => array ( 'col' => 'name,state,cdate', 'value' => array ( '"默认配置",1,' . time(), ), ), # request 请求接口定义 'request' => array ( # all 取所有数据 'all' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'name' => 'yes', ), 'type' => 'all', 'order' => array('id', 'desc'), 'col' => '*|id', ), # 取一条正常的数据 'info' => array ( # 匹配的正则或函数 选填项 'where' => array ( 'id' => 'yes', 'state' => 1, ), 'type' => 'one', ), ), );