大家好,我新学smarty,看到有很代码都有类似
    $smarty->template_dir = '../smarty/templates/';
    $smarty->compile_dir = '../smarty/templates_c/';
    $smarty->config_dir = '../smarty/configs/';
    $smarty->cache_dir = '../smarty/cache/';
的设置,还有cache时间,定界符等,我想知道这些设置是一次设置就全局OK,还是每个脚本都要包含这些语句,多谢!

解决方案 »

  1.   

    这是smarty配置文件,用的时候只要include ('smarty_inc.php')就可以了
      

  2.   

    这个你引用了smarty.class.php后写一个配置文件把这些配置全搞定就可以了!
      

  3.   

    在每个页面都写,或者2楼说的那样,写到一个通用文件中。包含即可
    我也在刚学习smarty