WeiPHP插件模板中快速引入公共模板文件
WeiPHP插件模板中快速引入公共模板文件,weiphp建立于onethink之上,简单修改代码,无需填写绝对路径实现轻松引入模板。记录一下,分享给需要的人。 修改文件: ThinkPHP/Library/Think/Template.class.php 3.2版本大约是326行左右。即parseInclude方法中 修改后代码贴出: // 解析模板中的include标签 protected function parseInclude($content, $extend = true) { // 解析继承 if($extend) $content = $this->parseExtend($content); // 解析布局 $content = $this->parseLayout($content); // 读取模板中的include标签 $find = preg_match_all('/'.$this->config['taglib_begin'].'include\s(.+?)\s*?\/'.$this->config['taglib_end'].'/is',$content,$matches); if($find) { for($i=0;$i<$find;$i++) { $include = $matches[1][$i]; $array = $this-