小弟是PHP的新手,想请问一下各位大侠如何配置smarty 3.07

解决方案 »

  1.   

    <?php
        include "../libs/Smarty.class.php";//加入smarty文件
    $NowPathArray=explode("test",str_replace("\\","/",dirname(__FILE__))) ;
        @define("root_path", $NowPathArray[0]);
        @define('__SITE_ROOT', root_path."test");
        $tpl = new Smarty();
        $tpl->template_dir = __SITE_ROOT . "/templates/";、、模板文件
        $tpl->compile_dir = __SITE_ROOT . "/templates_c/";//缓存垃圾文件
        $tpl->config_dir = __SITE_ROOT . "/configs/";
        $tpl->cache_dir = __SITE_ROOT . "/cache/";//缓存
        $tpl->left_delimiter = '<{';
        $tpl->right_delimiter = '}>';
    ?> 
      

  2.   

    给你个链接,你看看,自己就会看懂的!http://bbs.blueidea.com/viewthread.php?tid=2405738