| 插件名稱 | 表單系統(tǒng) V2.7 |
| 插件作者 | 迅睿官方自營 |
| 最近更新 | 2026-01-19 14:32:48 |
| 修復(fù)無法在列表的右側(cè)顯示評(píng)論入口按鈕 |
想在后臺(tái)的全局表單內(nèi)容列表里,操作選項(xiàng)里加一個(gè)右側(cè)鏈接按鈕,參考了
http://m.apdwn.com/doc/1232.html
http://m.apdwn.com/doc/1352.html
我的代碼是這樣的
// 數(shù)據(jù)列表
public function index() {
$tpl = $this->_Admin_List(true);
$this->mytable = [
'foot_tpl' => '', // 底部按鈕字符串
'link_tpl' => '', // 右側(cè)側(cè)鏈接字符串
'link_var' => 'html = html.replace(/\{id\}/g, row.id);', // 側(cè)鏈接的js變量替換,例如{id}表示id
];
// 側(cè)鏈接,加一個(gè)a標(biāo)簽鏈接
$this->mytable['link_tpl'].= '<label><a href="'.dr_url(APP_DIR.'/customer/show').'&id={id}" class="btn btn-xs blue"> <i class="fa fa-user"></i> 測試</a></label>';
\Phpcmf\Service::V()->assign([
'mytable' => $this->mytable,
]);
return \Phpcmf\Service::V()->display($tpl);
}為什么只剩下側(cè)鏈接一個(gè)按鈕了?沒加側(cè)鏈接代碼之前數(shù)據(jù)列表正常顯示的。

// 數(shù)據(jù)列表 public function index() { $tpl = $this->_Admin_List(true); // 側(cè)鏈接,加一個(gè)a標(biāo)簽鏈接 $this->mytable['link_tpl'].= '<label><a href="'.dr_url(APP_DIR.'/customer/show').'&id={id}" class="btn btn-xs blue"> <i class="fa fa-user"></i> 測試</a></label>'; \Phpcmf\Service::V()->assign([ 'mytable' => $this->mytable, ]); return \Phpcmf\Service::V()->display($tpl); }開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)@開源社區(qū)插件技術(shù)-小鵬 圖標(biāo)顯示正常了,數(shù)據(jù)列表還是無法顯示
用
list($tpl) = $this->_List();
能顯示數(shù)據(jù)列表,但是左側(cè)那些按鈕圖標(biāo)又不顯示了。。。。
// 數(shù)據(jù)列表 public function index() { $tpl = $this->_Admin_List(true); $this->mytable = \Phpcmf\Service::V()->get_value("mytable"); // 側(cè)鏈接,加一個(gè)a標(biāo)簽鏈接 $this->mytable['link_tpl'].= '<label><a href="'.dr_url(APP_DIR.'/customer/show').'&id={id}" class="btn btn-xs blue"> <i class="fa fa-user"></i> 測試</a></label>'; \Phpcmf\Service::V()->assign([ 'mytable' => $this->mytable, ]); return \Phpcmf\Service::V()->display($tpl); }開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!