<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                >[info] 考慮到很多人不會用命令行,這時你可以用瀏覽器來模擬命令行來生成文件 ## 開始使用 1. 訪問 http://yourdomain.com/admin/generate/cmd 會自動生成文件 2. 需要配置在后面通過 GET 請求傳參,例如 `generate/cmd?config=genereate&file=all` ![](https://box.kancloud.cn/5df95ac77a9e9a60b81deffe282a0ac0_454x138.png) ![](https://box.kancloud.cn/1732821ae7539d845343e61c8c519d01_587x152.png) 根目錄下的 `generate.php` ``` <?php return [ 'module' => 'admin', 'controller' => 'Test', 'title' => '測試', 'form' => [ [ 'title' => '字段一', 'name' => 'field1', 'type' => 'radio', 'option' => '1:值一#2:值二#3:值三', 'default' => '默認值', 'sort' => false, 'search' => true, 'search_type' => 'select', 'require' => true, 'validate' => [ 'datatype' => '*', 'nullmsg' => '為空信息', 'errormsg' => '錯誤信息', ], ], [ 'title' => '字段一', 'name' => 'field2', 'type' => 'date', 'option' => '1:值一#2:值二#3:值三', 'default' => '2', 'sort' => true, 'search' => true, 'search_type' => 'text', 'require' => true, 'validate' => [ 'datatype' => 'n', 'nullmsg' => '為空信息', 'errormsg' => '錯誤信息', ], ], [ 'title' => '狀態', 'name' => 'status', 'type' => 'radio', 'option' => '1:啟用#0:禁用', 'default' => '0', 'sort' => false, 'search' => false, 'search_type' => 'select', 'require' => true, 'validate' => [ 'datatype' => 'n', 'nullmsg' => '為空信息', 'errormsg' => '錯誤信息', ], ], ], 'create_table' => true, 'create_table_force' => false, 'table_name' => '', 'table_engine' => 'InnoDB', 'field' => [ [ 'name' => 'field1', 'type' => 'varchar(25)', 'default' => 123, 'not_null' => true, 'key' => true, 'comment' => '', 'extra' => '', // 擴展屬性,例如AUTO_INCREMENT ], [ 'name' => 'field2', 'type' => 'varchar(255)', 'default' => 123, 'allow_null' => true, 'key' => true, 'comment' => '', 'extra' => '', // 擴展屬性,例如AUTO_INCREMENT ], ], 'menu' => ['add', 'forbid', 'resume', 'delete', 'recyclebin'], 'auto_timestamp' => true, 'model' => false, 'validate' => false, ]; ``` >[info] 以下代碼、日志全部是自動生成,沒有做任何修改,包括縮進,嚴格的縮進非常方便二次編輯和查閱 ## 生成文件 ### controller/Test.php ``` <?php namespace app\admin\controller; \think\Loader::import('controller/Controller', \think\Config::get('traits_path') , EXT); use app\admin\Controller; class Test extends Controller { use \app\admin\traits\controller\Controller; // 方法黑名單 protected static $blacklist = []; protected function filter(&$map) { if ($this->request->param("field2")) { $map['field2'] = ["like", "%" . $this->request->param("field2") . "%"]; } } } ``` ### view/test/index.html ``` {extend name="template/base" /} {block name="content"} <div class="page-container"> {include file="form" /} <div class="cl pd-5 bg-1 bk-gray"> <span class="l"> {tp:menu menu="add,forbid,resume,delete,recyclebin" /} </span> <span class="r pt-5 pr-5"> 共有數據 :<strong>{$count ?? '0'}</strong> 條 </span> </div> <table class="table table-border table-bordered table-hover table-bg mt-20"> <thead> <tr class="text-c"> {include file="th" /} <th width="70">操作</th> </tr> </thead> <tbody> {volist name="list" id="vo"} <tr class="text-c"> {include file="td" /} <td class="f-14"> {$vo.status|show_status=$vo.id} {tp:menu menu='sedit' /} {tp:menu menu='sdelete' /} </td> </tr> {/volist} </tbody> </table> <div class="page-bootstrap">{$page ?? ''}</div> </div> {/block} {block name="script"} <script> $(function () { $("[name='field1']").find("[value='{$Request.param.field1}']").attr("selected", true); }) </script> {/block} ``` ### view/test/recyclebin.html ``` {extend name="template/recyclebin" /} {block name="script"} <script> $(function () { $("[name='field1']").find("[value='{$Request.param.field1}']").attr("selected", true); }) </script> {/block} ``` ### view/test/th.html ``` <th width="25"><input type="checkbox"></th> <th width="">字段一</th> <th width="">{:sort_by('字段一','field2')}</th> <th width="">狀態</th> ``` ### view/test/td.html ``` <td><input type="checkbox" name="id[]" value="{$vo.id}"></td> <td>{$vo.field1}</td> <td>{$vo.field2|high_light=$Request.param.field2}</td> <td>{$vo.status|get_status}</td> ``` ### view/test/form.html ``` <form class="mb-20" method="get" action="{:\\think\\Url::build($Request.action)}"> <div class="select-box" style="width:250px"> <select name="field1" class="select"> <option value="1">值一</option> <option value="2">值二</option> <option value="3">值三</option> </select> </div> <input type="text" class="input-text" style="width:250px" placeholder="字段一" name="field2" value="{$Request.param.field2}" > <button type="submit" class="btn btn-success"><i class="Hui-iconfont">&#xe665;</i> 搜索</button> </form> ``` ### view/test/edit.html ``` {extend name="template/base" /} {block name="content"} <div class="page-container"> <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}"> <input type="hidden" name="id" value="{:isset($vo.id)?$vo.id:''}"> <div class="row cl"> <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>字段一:</label> <div class="formControls col-xs-6 col-sm-6 skin-minimal"> <div class="radio-box"> <input type="radio" name="field1" id="field1-1" value="1" datatype="*" nullmsg="為空信息" errormsg="錯誤信息"> <label for="field1-1">值一</label> </div> <div class="radio-box"> <input type="radio" name="field1" id="field1-2" value="2" datatype="*" nullmsg="為空信息" errormsg="錯誤信息"> <label for="field1-2">值二</label> </div> <div class="radio-box"> <input type="radio" name="field1" id="field1-3" value="3" datatype="*" nullmsg="為空信息" errormsg="錯誤信息"> <label for="field1-3">值三</label> </div> </div> <div class="col-xs-3 col-sm-3"></div> </div> <div class="row cl"> <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>字段一:</label> <div class="formControls col-xs-6 col-sm-6"> <input type="text" class="input-text Wdate" placeholder="字段一" name="field2" value="{$vo.field2 ?? '2'}" {literal} onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" {/literal} > </div> <div class="col-xs-3 col-sm-3"></div> </div> <div class="row cl"> <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>狀態:</label> <div class="formControls col-xs-6 col-sm-6 skin-minimal"> <div class="radio-box"> <input type="radio" name="status" id="status-1" value="1" datatype="n" nullmsg="為空信息" errormsg="錯誤信息"> <label for="status-1">啟用</label> </div> <div class="radio-box"> <input type="radio" name="status" id="status-0" value="0" datatype="n" nullmsg="為空信息" errormsg="錯誤信息"> <label for="status-0">禁用</label> </div> </div> <div class="col-xs-3 col-sm-3"></div> </div> <div class="row cl"> <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3"> <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button> <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button> </div> </div> </form> </div> {/block} {block name="script"} <script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script> <script type="text/javascript" src="__LIB__/My97DatePicker/WdatePicker.js"></script> <script> $(function () { $("[name='field1'][value='{$vo.field1 ?? '默認值'}']").attr("checked", true); $("[name='status'][value='{$vo.status ?? '0'}']").attr("checked", true); $('.skin-minimal input').iCheck({ checkboxClass: 'icheckbox-blue', radioClass: 'iradio-blue', increaseArea: '20%' }); $("#form").Validform({ tiptype: 2, ajaxPost: true, showAllError: true, callback: function (ret){ ajax_progress(ret); } }); }) </script> {/block} ``` ### view/test/config.php ``` <?php return array ( 'module' => 'admin', 'menu' => array ( 0 => 'add', 1 => 'forbid', 2 => 'resume', 3 => 'delete', 4 => 'recyclebin', ), 'create_config' => true, 'controller' => 'Test', 'title' => '測試', 'form' => array ( 0 => array ( 'title' => '字段一', 'name' => 'field1', 'type' => 'radio', 'option' => '1:值一#2:值二#3:值三', 'default' => '默認值', 'sort' => false, 'search' => true, 'search_type' => 'select', 'require' => true, 'validate' => array ( 'datatype' => '*', 'nullmsg' => '為空信息', 'errormsg' => '錯誤信息', ), ), 1 => array ( 'title' => '字段一', 'name' => 'field2', 'type' => 'date', 'option' => '1:值一#2:值二#3:值三', 'default' => '2', 'sort' => true, 'search' => true, 'search_type' => 'text', 'require' => true, 'validate' => array ( 'datatype' => 'n', 'nullmsg' => '為空信息', 'errormsg' => '錯誤信息', ), ), 2 => array ( 'title' => '狀態', 'name' => 'status', 'type' => 'radio', 'option' => '1:啟用#0:禁用', 'default' => '0', 'sort' => false, 'search' => false, 'search_type' => 'select', 'require' => true, 'validate' => array ( 'datatype' => 'n', 'nullmsg' => '為空信息', 'errormsg' => '錯誤信息', ), ), ), 'create_table' => true, 'create_table_force' => false, 'table_name' => '', 'table_engine' => 'InnoDB', 'field' => array ( 0 => array ( 'name' => 'field1', 'type' => 'varchar(25)', 'default' => 123, 'not_null' => true, 'key' => true, 'comment' => '', 'extra' => '', ), 1 => array ( 'name' => 'field2', 'type' => 'varchar(255)', 'default' => 123, 'allow_null' => true, 'key' => true, 'comment' => '', 'extra' => '', ), ), 'auto_timestamp' => true, 'model' => false, 'validate' => false, ); ``` >[info] 因已經存在 `tp_test` 表,選項中 `create_table_force` 的值為 `false`,未生成數據表
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看