Php smarty包含包含动态内容的页面

Php smarty包含包含动态内容的页面,php,smarty,Php,Smarty,php包括一些模块页面,_head.tpl,_foot.tpl index.php: <{include file="_head.tpl"}> .... <php? .... ?> <{include file="_footer.tpl"}> .... \u head.tpl <html> <head></head> <body> <{include file="$baseUrl/menu/ind

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

index.php:

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

....
\u head.tpl

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

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


打开url:www.test.com/menu/index可以获取动态内容。将列表的内容复制到“\u head.tpl”而不是smarty句子(),“www.test.com/index”显示得很好。

您不能像这样直接指定。您必须使用php文件\u get\u contents或Curl获取内容

请参阅: