业务经理

微信扫描以上二维码

028-61286886

技术咨询

$myfield 也能正常显示我自定义的字段

迅睿框架 更新 2021-07-05 16:04:49 百科仙书

我有一个表单。$myfield 也能正常显示我自定义的字段
模板就是编辑页edit.html模板,只是我自定义了一个控制器。其实是就跟原来的编辑控制器是完全一样的。

我想单独显示一个我自定义的一个字段(Ftable 类型),使用了文档中的方法。

{dr_fieldform($ci->module['field']['thumb'], $thumb)}   成功显示
{dr_fieldform($ci->module['field']['我的字段名'], $我的字段名)}  不成功,显示 字段数据不存在

请问是我使用的方法不对么?

方案

  • 官方研发技术-阿华 #1 · 2021-06-26 16:22:10
    自定义了一个控制器的路径是什么呢
  • 百科仙书 #2 · 2021-06-26 16:46:30
    index.php?s=member&app=goods&c=extask&m=edit_tender&id=84&cid=88

    edit_tender是我自定的edit
  • 官方研发技术-阿华 #3 · 2021-06-26 16:49:59
    edit_tender 函数体内的代码需要发出来看看
  • 百科仙书 #4 · 2021-06-26 16:51:45
    就是Fcms.编辑的代码完全复制
  • 官方研发技术-阿华 #5 · 2021-06-26 16:56:38
    需要看看具体的源码
  • 百科仙书 #6 · 2021-06-28 11:03:57
    官方研发技术-阿华 这里是控制器代码
    public function edit_tender() {
            
            $id = intval(\Phpcmf\Service::L('input')->get('id'));
            $did = 0;
            $this->is_get_catid = intval(\Phpcmf\Service::L('input')->get('catid'));
    
            if (defined('IS_MODULE_VERIFY')) {
                $draft = [];
            } else {
                $did = intval(\Phpcmf\Service::L('input')->get('did'));
                $did && $this->auto_save = 0; // 草稿数据时不加载
                $draft = $did ? $this->content_model->get_draft($did) : [];
            }
            list($tpl, $data) = $this->_Post($id, $draft);
            if (!$data) {
                $this->_msg(0, dr_lang('内容不存在'));
            } elseif ($this->uid != $data['uid']) {
                $this->_msg(0, dr_lang('无权限操作'));
            } elseif (defined('IS_MODULE_VERIFY') && $data['status'] != 0) {
                // 判断是否来至审核
                $this->_msg(0, dr_lang('正在审核之中'));
            }
    
            $category = [];
            if (defined('IS_MODULE_VERIFY')) {
                // 审核文章编辑时采用投稿权限判断
                // 可编辑的栏目
                $category = $this->_get_module_member_category($this->module, 'add');
                if (!$category[$data['catid']]) {
                    $this->_msg(0, dr_lang('当前栏目[%s]没有发布权限', $this->module['category'][$data['catid']]['name']));
                }
            } else {
                if (!$this->is_hcategory) {
                    // 可编辑的栏目
                    $category = $this->_get_module_member_category($this->module, 'edit');
                    if (!$category[$data['catid']]) {
                        $this->_msg(0, dr_lang('当前栏目[%s]没有修改权限', $this->module['category'][$data['catid']]['name']));
                    }
                } else {
                    $rt = $this->content_model->_hcategory_member_edit_auth();
                    if (!$rt['code']) {
                        $this->_msg(0, $rt['msg'], $rt['data']);
                    }
                }
            }
    
            \Phpcmf\Service::V()->assign([
                'did' => $did,
                'form' =>  dr_form_hidden(['is_draft' => 0, 'module' => $this->module['dirname'], 'id' => $id]),
                'select' => \Phpcmf\Service::L('Tree')->select_category(
                    $category,
                    $data['catid'],
                    'id=\'dr_catid\' name=\'catid\' onChange="show_category_field(this.value)"',
                    '--', 1, 1
                ),
                'is_verify' => defined('IS_MODULE_VERIFY') ? 1 : 0,
                'is_sync_cat' => defined('IS_MODULE_VERIFY') ? $data['sync_cat'] : '',
                'draft_url' =>\Phpcmf\Service::L('Router')->member_url($this->module['dirname'].'/home/edit', ['id' => $id]),
                'draft_list' => $this->content_model->get_draft_list('cid='.$id),
                'is_post_code' => $this->is_hcategory ? $this->content_model->_hcategory_member_post_code() : $this->is_post_code,
                'category_field_url' => $this->is_post_code || $this->module['category_data_field'] ? dr_member_url($this->module['dirname'].'/'.(defined('IS_MODULE_VERIFY') ? 'verify' : 'home').'/edit', ['id' => $id]) : ''
            ]);
            \Phpcmf\Service::V()->display('extask_tender.html');
        }
  • 官方研发技术-阿华 #7 · 2021-06-28 11:07:49
    满意答案
    public function edit_tender() {
    
    var_dump($this->module['field']);
    看看有没有什么数据
  • 百科仙书 #8 · 2021-07-05 16:04:49
    @官方研发技术-阿华:已经用其他方法替代了。

迅睿系统漏洞

站群分站系统
站群分站系统(2026-10-15)
子站域名新增llms.txt访问
GEO系统
GEO系统(2026-10-14)
修复下载zip空白地址问题 修复流量复刻和任务队列错误
GeoSeo收录宝
GeoSeo收录宝(2026-10-14)
新增 站长工具箱 前端首页自动调用meta 数据
滑块验证码 Gocaptcha
滑块验证码 Gocaptcha(2026-10-13)
基于开源项目 go-captcha 的行为验证码插件,滑动拼图、区域...
GeoSeo工具箱
GeoSeo工具箱(2026-10-13)
优化巡检任务
GeoSeo排名助手
GeoSeo排名助手(2026-10-11)
加入大模型自定义
SEO聚合关键字
SEO聚合关键字(2026-10-11)
优化关键字列表页最多支持1万篇文章,过多会导致服务器扛不住;
CMS内容同步复制
CMS内容同步复制(2026-10-10)
增加时间是否更新的开关