Thinkphp 5 RC3

浏览:651 发布日期:2016/05/13 分类:ThinkPHP5专区 关键字: 模版
$view = new View();
return $view ->fetch('./hello');
我渲染模版,路径正确,结果没有当作HTML来解析而是在文档前加了PRE标签,把整个视图当作字符串来输出,hello.html是视图文件,是不是哪里少了什么参数?
"<!DOCTYPE html>\r\n<!--\r\nTo change this license header, choose License Headers in Project Properties.\r\nTo change this template file, choose Tools | Templates\r\nand open the template in the editor.\r\n-->\r\n<html>\r\n <head>\r\n <title>这就是我<\/title>\r\n <meta charset=\"UTF-8\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n <\/head>\r\n <body>\r\n <div>I LIKE IT<\/div>\r\n <\/body>\r\n<\/html>\r\n"[/code][code]
最佳答案
评论( 相关
后面还有条评论,点击查看>>