腾讯云优惠券
继承呆错后台管理框架后台基类模板开发插件后台的表单实例
人气:367 更新:2022-02-12

添加数据表单实例

{extend name="apps/common/view/admin.tpl" /}
<!-- -->
{block name="header_meta"}
<title>{:lang('daohang/admin/create')}-{:lang('appName')}</title>
{/block}
{block name="header_addon"}
<link href="{$path_root}{$path_addon}view/theme.css" rel="stylesheet">
<script src="{$path_root}{$path_addon}view/theme.js"></script>
{/block}
<!-- -->
{block name="main"}
<h6 class="border-bottom pb-2 mb-2 text-purple">
  {:lang('daohang/admin/create')}
</h6>
<!-- -->
{:DcBuildForm([
    'name'     => 'daohang/web/create',
    'class'    => 'bg-white form-create',
    'action'   => DcUrlAddon(['module'=>'daohang','controll'=>'admin','action'=>'save']),
    'method'   => 'post',
    'submit'   => lang('submit'),
    'reset'    => lang('reset'),
    'close'    => false,
    'disabled' => false,
    'callback' => '',
    'ajax'     => true,
    'data'     => '',
    'items'    => $fields,
])}
{/block}

编辑数据表单实例

{extend name="apps/common/view/admin.tpl" /}
<!-- -->
{block name="header_meta"}
<title>{:lang('daohang/admin/edit')}-{:lang('appName')}</title>
{/block}
{block name="header_addon"}
<link href="{$path_root}{$path_addon}view/theme.css" rel="stylesheet">
<script src="{$path_root}{$path_addon}view/theme.js"></script>
{/block}
<!-- -->
{block name="main"}
<h6 class="border-bottom pb-2 mb-0 text-purple">
  {:lang('daohang/admin/edit')}
</h6>
<!-- -->
{:DcBuildForm([
    'name'     => 'daohang/web/edit',
    'class'    => 'bg-white form-edit py-2',
    'action'   => DcUrlAddon(['module'=>'daohang','controll'=>'admin','action'=>'update']),
    'method'   => 'post',
    'submit'   => lang('submit'),
    'reset'    => lang('reset'),
    'close'    => false,
    'disabled' => false,
    'callback' => '',
    'ajax'     => true,
    'data'     => $data,
    'items'    => $fields,
])}
{/block}