smarty的具体用法可以看他的文档,挺全的,http://smarty.php.net
中文翻译版:http://www.hiweed.com/xoops/modules/mydownloads/visit.php?cid=2&lid=102smarty速度应该比phplib快吧,别人试验得出结果,第一次浏览时他比phplib慢,以后浏览时速度均快于phplib,php官方推荐的东东,不过俺还是比较习惯使用phplib

解决方案 »

  1.   

    phplib也算是名声在外了,二者的选择确实有一个习惯的问题。
      

  2.   

    装好smarty了,但是运行他自带的demo文件出错,是怎么回事?Warning: Smarty error: problem writing temporary file 'templates_c\_smarty_cached_paths\3f518bd233a35' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\_smarty_cached_paths\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: Smarty error: problem writing temporary file 'templates_c\_smarty_cached_paths\3f518bd24768f' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\_smarty_cached_paths\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: Smarty error: problem writing temporary file 'templates_c\_smarty_cached_paths\3f518bd249e24' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\_smarty_cached_paths\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: Smarty error: problem writing temporary file 'templates_c\_smarty_cached_paths\3f518bd24fca5' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\_smarty_cached_paths\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: Smarty error: problem writing temporary file 'templates_c\_smarty_cached_paths\3f518bd2574c4' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\_smarty_cached_paths\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: Smarty error: problem writing temporary file 'templates_c\%%117\%%1172603085\3f518bd25f3d6' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\%%117\%%1172603085\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: fetch(templates_c\%%117\%%1172603085\index.tpl.php): failed to open stream: No such file or directory in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1323Warning: fetch(): Failed opening 'templates_c\%%117\%%1172603085\index.tpl.php' for inclusion (include_path='.;c:\php4\pear') in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1323Warning: Smarty error: problem writing temporary file 'templates_c\_smarty_cached_paths\3f518bd260d90' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\_smarty_cached_paths\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: Smarty error: problem writing temporary file 'templates_c\_smarty_cached_paths\3f518bd268bd0' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\_smarty_cached_paths\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: Smarty error: problem writing temporary file 'templates_c\_smarty_cached_paths\3f518bd26bac3' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\_smarty_cached_paths\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: Smarty error: problem writing temporary file 'templates_c\_smarty_cached_paths\3f518bd26eda2' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\_smarty_cached_paths\index.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: Smarty error: problem writing temporary file 'templates_c\%%-10\%%-1005548203\3f518bd27cd0d' in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 1156Warning: touch(): Unable to access templates_c\%%-10\%%-1005548203\debug.tpl.php in F:\Apache2\htdocs\php\smarty\libs\core\core.write_compiled_resource.php on line 31Warning: _include(templates_c\%%-10\%%-1005548203\debug.tpl.php): failed to open stream: No such file or directory in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 2042Warning: _include(): Failed opening 'templates_c\%%-10\%%-1005548203\debug.tpl.php' for inclusion (include_path='.;c:\php4\pear') in F:\Apache2\htdocs\php\smarty\libs\Smarty.class.php on line 2042
      

  3.   

    smarty是一个很完整的系统,以其为核心用在小型和部分中型网站中非常不错。但如果是一个企业级的大型应用,用smarty会有诸多不便。不如phplib作为整个系统的一个小巧且功能强大的模块用起来方便~!其实模板还有一个是很著名,且功能强大的东西,叫smart template。
    这个东西偶只做着玩过,没有在实际工作中用过,不敢评价太多。呵呵
      

  4.   

    我不同意楼上说的。。smarty更适合团队开发的大型项目。他的cache功能太COOL了。phplib用起来才是麻烦。看这里:http://www.phpe.net/articles/361.shtml这篇文章已经写得很清楚了。