看了thinkphp5包含文件include标签不支持动态的传参数

作者: cayman 分类: 编程技术 发布时间: 2019-03-29 23:28

{include file=”$param/head”}
看了网上的几种方法,只能去修改原始方法文件了
thinkphp\library\think\Template.php文件下的parseInclude方法

if($array['append']){
                        if(0===strpos($array['append'],'$')){
                            $array['append'] = $this->get(substr($array['append'],1));
                        }
                        $file = $array['append'].$array['file'];
                        unset($array['append']);
                    }else{
                        $file  = $array['file'];
                    }

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注