1

We used the smarty template engine as the framework for my site. I am trying to add static pages to the site, but I cannot get the new static pages to appear.

Can someone please tell me what I need to do to get a new page to appear?

Here is an example. My About Us Page is located at www.domain.com/about. This page is called about.tpl

I want to add another page called 'history'. The page is saved as history.tpl. I FTP'd the page to my server, but when I go to www.domain.com/help it does not appear.

I feel like I'm missing some sort of important step to get the help.tpl page to appear.

4

1 回答 1

2

请记住 smarty 是 PHP 的模板引擎。您不能只上传一个模板文件并期望您的主页在没有任何参考的情况下显示它,您至少需要几行 PHP 代码来加载和显示它。

使用 smarty 模板的基本设置是这样的:

<?php

require_once(YOUR_SMARTY_DIR . 'Smarty.class.php');

$smarty = new Smarty();
$smarty->display('your_template.tpl');

?>

如果你有这样的脚本,可以调用它about.php,上传它,然后转到,如果配置正确,将显示www.yoursite.com/about.php模板。your_template.tpl

于 2013-07-04T18:00:07.590 回答