本站资源均来自互联网,仅供学习与参考,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
Copyright @ 2015-2020 织梦园 版权所有
Power by DedeCms
鲁ICP备15039853号-1
鲁公网安备 37132302000249号
模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
前面有提到,在DEDEcms的/member和/plus文件夹下,有许多模板需要调用当前模板的头部和尾部,但是笔者发现,同时使用同一个变量<?php pasterTempletDiy("head.htm"); ?>会出现问题,plus能正常使用,而会员中心却打不开,其实解决办法很简单,就是单独写变量。方法如下
会员部分打开/member/config.php,在***下面添加如下代码
//引入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(); } |
对应模板用
<?php pasterTempletDiy("head.htm"); ?>
<?php pasterTempletDiy("footer.htm"); ?>
/plus文件部分,把变量pasterTempletDiy换成变量pasterTempletDiy2即可,
//引入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"); ?>