刚下的smarty3,按照说明稍微部署了下,运行里边儿的测试页面 index.php(http://localhost/Smarty/demo/index.php)一切正常。
参照某个教程自己做了一个页面出现问题了: 打开http://localhost/Smarty/demo/test.php 里面全是空白。
samrty放置路径:F:\work\PhonesCalls\Smarty;
main.php (F:\work\PhonesCalls\Smarty\libs\main.php): <?php
include "libs/Smarty.class.php";
define('__SITE_ROOT', 'F:/work/PhonesCalls/Smarty/demo');
$tpl = new Smarty();
$tpl->template_dir = __SITE_ROOT . "/templates/";
$tpl->compile_dir = __SITE_ROOT . "/templates_c/";
$tpl->config_dir = __SITE_ROOT . "/configs/";
$tpl->cache_dir = __SITE_ROOT . "/cache/";
$tpl->left_delimiter = '<{';
$tpl->right_delimiter = '}>';
?>test.php (F:\work\PhonesCalls\Smarty\demo\test.php) <?php
require "main.php";
$tpl->assign("title", "测试用的网页标题");
$tpl->assign("content", "测试用的网页内容");
$tpl->display('test.html');
?>
test.html (F:\work\PhonesCalls\Smarty\demo\templates\test.html) <html>
<head>
<meta http-equiv="Content-Type" c>
<title><{$title}></title>
</head>
<body>
<{$content}>
</body>
</html>
找了半天还是没发现是逻辑上面的问题还是代码的问题
参照某个教程自己做了一个页面出现问题了: 打开http://localhost/Smarty/demo/test.php 里面全是空白。
samrty放置路径:F:\work\PhonesCalls\Smarty;
main.php (F:\work\PhonesCalls\Smarty\libs\main.php): <?php
include "libs/Smarty.class.php";
define('__SITE_ROOT', 'F:/work/PhonesCalls/Smarty/demo');
$tpl = new Smarty();
$tpl->template_dir = __SITE_ROOT . "/templates/";
$tpl->compile_dir = __SITE_ROOT . "/templates_c/";
$tpl->config_dir = __SITE_ROOT . "/configs/";
$tpl->cache_dir = __SITE_ROOT . "/cache/";
$tpl->left_delimiter = '<{';
$tpl->right_delimiter = '}>';
?>test.php (F:\work\PhonesCalls\Smarty\demo\test.php) <?php
require "main.php";
$tpl->assign("title", "测试用的网页标题");
$tpl->assign("content", "测试用的网页内容");
$tpl->display('test.html');
?>
test.html (F:\work\PhonesCalls\Smarty\demo\templates\test.html) <html>
<head>
<meta http-equiv="Content-Type" c>
<title><{$title}></title>
</head>
<body>
<{$content}>
</body>
</html>
找了半天还是没发现是逻辑上面的问题还是代码的问题
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货