• 技术文章 >后端开发 >php教程

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

    2016-06-13 12:45:23原创374
    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

    Web大前端开发直播班

    相关文章推荐

    • php中session与cookie的比较_PHP• WampServer下安装多个版本的PHP、mysql、apache图文教程_PHP• 深入解读php中关于抽象(abstract)类和抽象方法的问题分析_PHP• 浅析51个PHP处理字符串的函数_PHP• win7下memCache的安装过程(具体操作步骤)_PHP
    1/1

    PHP中文网