POST TIME:2017-11-13 00:38
前面有提到,在DEDEcms的/member和/plus文件夾下,有許多模板需要調(diào)用當(dāng)前模板的頭部和尾部,但是筆者發(fā)現(xiàn),同時(shí)使用同一個(gè)變量<?php pasterTempletDiy("head.htm"); ?>會(huì)出現(xiàn)問(wèn)題,plus能正常使用,而會(huì)員中心卻打不開,其實(shí)解決辦法很簡(jiǎn)單,就是單獨(dú)寫變量。方法如下
//引入arc.partview.class.php類處理 require_once(DEDEINC."/arc.partview.class.php"); function pasterTempletDiy($path) { global $cfg_basedir,$cfg_templets_skin; $tmpfile = $cfg_basedir.$cfg_templets_skin."/".$path;//模版文件的路徑 $dtp = new PartView(); $dtp->SetTemplet($tmpfile); $dtp->Display(); }
對(duì)應(yīng)模板用
<?php pasterTempletDiy("head.htm"); ?> <?php pasterTempletDiy("footer.htm"); ?>
//引入arc.partview.class.php類處理////////////////////////////////////////////////////// require_once(DEDEINC."/arc.partview.class.php"); function pasterTempletDiy2($path) { global $cfg_basedir,$cfg_templets_skin; $tmpfile = $cfg_basedir.$cfg_templets_skin."/".$path;//模版文件的路徑 $dtp = new PartView(); $dtp->SetTemplet($tmpfile); $dtp->Display(); }
<?php pasterTempletDiy2("head.htm"); ?> <?php pasterTempletDiy2("footer.htm"); ?>