php smaarty 访问显示空白,什么内容都没有?
时间: 2014-10-31来源:开源中国
前景提要
HDC调试需求开发(15万预算),能者速来!>>>
访问http://127.0.0.1/smarty/test/test.php 一片空白 什么也没有 之前控制台报 server 500
现在不报了
但问题还没有解决,不知道什么原因,小白求助。。
test.php代码如下 <?php require("lib/Smarty.class.php"); //引入smarty $smarty = new Smarty(); $smarty->left_delimiter ="{";//左定界符 $smarty->right_delimiter="}"; $smarty->template_dir ="tpl";//视图模板存放地址 $smarty->compile_dir="template_c"; //模板编译后的存放目录 $smarty->cache_dir = "cache"; //缓存 $smarty->caching = true; $smarty->cache_lifetime = 120; //缓存时间 //smarty常用方法 $smarty->assign("title","标题"); //变量,value $smarty->assign("content","内容"); $smarty->display("test.html"); //模板名称 ?> 放在tpl文件夹的 test.html <html> <head> <title> {$title} </title> <body> {$content} </body> </head> </html> 使用的是ubuntut14.04 。

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行