Home >Backend Development >PHP Tutorial > smarty的有关问题-变量无法在html中显示

smarty的有关问题-变量无法在html中显示

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:45:23953browse

smarty的问题---变量无法在html中显示
1.php
include_once("libs/Smarty.class.php");
$smarty=new Smarty();

$smarty->template_dir="templates";
$smarty->compile_dir="compile";
$smarty->config_dir="config";
$smarty->cache_dir="cache";

$smarty->left_delimiter="{";
$smarty->right_delimiter="}";
?>

2.php
include ("smarty_include.php");
$name="this is an apple!";
$smarty->assign("abc",$name);
$smarty->display("index.html");
?>

index.html

    


        

 {$abc} 


    


index里面的$abc无法显示出$name的值
2.php里可以显示出this is an apple!
请问这是为什么
Smarty HTML
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn