您的位置 首页 php

php配置smarty模板引擎几行有用的代码

define(‘REAL_PATH’, dirname(__FILE__));//当前绝对路径

$_smarty->setCacheDir(REAL_PATH.’/cache’);//设置缓存目录

$_smarty->setConfigDir(REAL_PATH.’/configs’);//设置配置目录

$_smarty->setPluginsDir(REAL_PATH.’/plugins’);//设置自定义插件目录

$_smarty->setTemplateDir(REAL_PATH.’/templates’);//设置模板目录

$_smarty->setCompileDir(REAL_PATH.’/templates_c’);//设置编译目录

$_smarty->addPluginsDir(REAL_PATH.’/smarty/plugins’);//设置系统自带的插件目录

$_smarty->testInstall();//检测Smarty目录结构配置是否有效

文章来源:智云一二三科技

文章标题:php配置smarty模板引擎几行有用的代码

文章地址:https://www.zhihuclub.com/153271.shtml

关于作者: 智云科技

热门文章

网站地图