## 开始使用
0. 在从数据表生成选项后下拉框里选择需要从表生成的数据表,页面会刷新,载入数据表字段
1. 页面会根据表名自动生成一个控制器名,但对于多级控制器,默认生成的控制器名是错误的,需要手动修改,然后填写后面的控制器标题
2. 删除表单元素里的不需要的字段,例如 `id`
3. 完善表单元素信息
4. 勾选需要生成的首页菜单
5. 勾选是否创建模型和验证器
6. 点击生成





>[info] 以下代码、日志全部是自动生成,没有做任何修改,包括缩进,严格的缩进非常方便二次编辑和查阅
## 生成文件
### controller/File.php
```
namespace appadmincontroller;
thinkLoader::import('controller/Controller', thinkConfig::get('traits_path') , EXT);
use appadminController;
class File extends Controller
{
use appadmintraitscontrollerController;
// 方法黑名单
protected static $blacklist = [];
protected static $isdelete = false;
protected function filter(&$map)
{
if ($this->request->param("name")) {
$map['name'] = ["like", "%" . $this->request->param("name") . "%"];
}
if ($this->request->param("original")) {
$map['original'] = ["like", "%" . $this->request->param("original") . "%"];
}
if ($this->request->param("domain")) {
$map['domain'] = ["like", "%" . $this->request->param("domain") . "%"];
}
if ($this->request->param("type")) {
$map['type'] = ["like", "%" . $this->request->param("type") . "%"];
}
}
}
```
### view/file/index.html
```
{extend name="template/base" /}
{block name="content"}
{tp:menu menu="add" /}
共有数据 :
{$count ?? '0'} 条
{$page ?? ''}
{/block}
```
>[info] 因为没有选择创建回收站(recyclebin.html)自动合并 th.html、td.html、form.html 到 index.html 文件中
### view/file/edit.html
```
{extend name="template/base" /}
{block name="content"}
{/block}
{block name="script"}
{/block}
```
### view/file/config.php
```
return array (
'module' => 'admin',
'menu' =>
array (
0 => 'add',
),
'create_config' => true,
'controller' => 'File',
'title' => '文件',
'form' =>
array (
2 =>
array (
'title' => '目录',
'name' => 'cate',
'type' => 'select',
'option' => '',
'default' => '',
'search_type' => 'text',
'require' => '1',
'validate' =>
array (
'datatype' => '*',
'nullmsg' => '',
'errormsg' => '',
),
),
3 =>
array (
'title' => '文件名',
'name' => 'name',
'type' => 'text',
'option' => '',
'default' => '',
'search' => '1',
'search_type' => 'text',
'require' => '1',
'validate' =>
array (
'datatype' => '*',
'nullmsg' => '',
'errormsg' => '',
),
),
4 =>
array (
'title' => '原文件名',
'name' => 'original',
'type' => 'text',
'option' => '',
'default' => '',
'search' => '1',
'search_type' => 'text',
'require' => '1',
'validate' =>
array (
'datatype' => '*',
'nullmsg' => '',
'errormsg' => '',
),
),
5 =>
array (
'title' => '域名',
'name' => 'domain',
'type' => 'text',
'option' => '',
'default' => '',
'search' => '1',
'search_type' => 'text',
'validate' =>
array (
'datatype' => '',
'nullmsg' => '',
'errormsg' => '',
),
),
6 =>
array (
'title' => '文件类型',
'name' => 'type',
'type' => 'select',
'option' => '',
'default' => '',
'search' => '1',
'search_type' => 'text',
'validate' =>
array (
'datatype' => '',
'nullmsg' => '',
'errormsg' => '',
),
),
7 =>
array (
'title' => '文件大小',
'name' => 'size',
'type' => 'number',
'option' => '',
'default' => '',
'sort' => '1',
'search_type' => 'text',
'require' => '1',
'validate' =>
array (
'datatype' => '*',
'nullmsg' => '',
'errormsg' => '',
),
),
8 =>
array (
'title' => '修改时间',
'name' => 'mtime',
'type' => 'text',
'option' => '',
'default' => '',
'sort' => '1',
'search_type' => 'text',
'validate' =>
array (
'datatype' => '',
'nullmsg' => '',
'errormsg' => '',
),
),
),
);
```