smarty包含一个包含动态内容的页面

时间:2012-06-15 07:16:35

标签: php smarty

index.php包含一些模块页面_head.tpl,_foot.tpl

的index.php:

<{include file="_head.tpl"}>
....
<php?
  ....
?>
<{include file="_footer.tpl"}>

_head.tpl

<html>
<head></head>
<body>
<{include file="$baseUrl/menu/index"}>
.....

打开网址时:www.test.com/index显示“http 500错误”

打开网址: www.test.com/menu/index 可以获得动态内容。将列表内容复制到“_head.tpl”而不是智能句子(&lt; {include file =“$ baseUrl / menu / index”}&gt; ),“ www .test.com / index “显示得很好。

1 个答案:

答案 0 :(得分:0)

你不能直接具体这样。你必须使用php file_get_contents或Curl。

获取内容

请参阅此处:http://www.smarty.net/forums/viewtopic.php?p=78900

相关问题