我有一个表单。$myfield 也能正常显示我自定义的字段
模板就是编辑页edit.html模板,只是我自定义了一个控制器。其实是就跟原来的编辑控制器是完全一样的。
我想单独显示一个我自定义的一个字段(Ftable 类型),使用了文档中的方法。
{dr_fieldform($ci->module['field']['thumb'], $thumb)} 成功显示{dr_fieldform($ci->module['field']['我的字段名'], $我的字段名)} 不成功,显示 字段数据不存在请问是我使用的方法不对么?
edit_tender是我自定的edit
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'); }public function edit_tender() { var_dump($this->module['field']);看看有没有什么数据