Smarty五配置两方法

<?php

  require('../smarty/Smarty.class.php');

  $smarty=new Smarty();

  //Smarty"五配置两方法"

  //五配置的介绍

  $smarty->left_delimiter="{";  //左定界符

  $smarty->right_delimilter="}";  //右定界符

  $smarty->template_dir="tpl";  //html模板的地址

  $smarty->compile_dir="template_c";  //模板编译生成的文件

  $smarty->cache_dir="cache";  //缓存

  //两方法开启缓存,因为通常不开启缓存机制,所以此项为了解

  //$smarty->caching = true;  //开启缓存

  //$smarty->cache_lifetime = 120;  //缓存时间

 

  $smarty->assign('articletitle','文章标题');  

  $smarty->display('test.tpl');

?>

相关文章:

  • 2021-07-03
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
猜你喜欢
  • 2022-03-05
  • 2021-04-13
  • 2021-10-31
  • 2022-02-18
相关资源
相似解决方案