php开启smarty

xiaoxiao2021-02-28  166

1.开启smarty

 

//时域 session_start(); //定义时区 date_default_timezone_set('Asia/Shanghai');//news add用到 //定义常量 define("BASE_URL","http://localhost/cms/"); define('CONTROLLER_PATH','protected/controller/'); define('TEMPLATES_PATH','protected/templates/'); //smarty require('protected/libs/smarty/Smarty.class.php'); $smarty = new Smarty; $smarty->template_dir = TEMPLATES_PATH.'site/'; $smarty->compile_dir = TEMPLATES_PATH.'templates_c/'; //$smarty->config_dir = '/web/www.mydomain.com/smarty/guestbook/configs/'; $smarty->cache_dir = TEMPLATES_PATH.'cache/'; $smarty->left_delimiter='<{'; $smarty->right_delimiter='}>'; //开启缓存 //第一种 //$smarty->caching=true;//所有缓存只保留1小时 //第二种 $smarty->caching=2;//

 

 

 

 

 

转载请注明原文地址: https://www.6miu.com/read-25954.html

最新回复(0)