当前位置: 首页 > 未分类>阅读正文

smarty 配置项

2022.7.9 朱丰华 1114 次 留下评论 577字

通常需要设置 smarty 的左右定界符,以及设置配置目录

1,Smarty左右定界符配置
    在Smarty中,默认使用{ }作为变量的定界符,但是会与CSS,JS中的大括号冲突
        左定界符:$Smarty->left_delimiter="string"
        右定界符:$Smarty->right_delimeter="string"
        

2,Smarty常用目录配置
    目录类别                默认目录    修改方法                    查看方法
    Smarty默认模板目录    ./templates $smarty->setTemplateDir()   $smarty->getTemplateDir()
    Smarty默认配置目录    ./configs   $smarty->setConfigDir()   $smarty->getConfigDir()
    Smarty默认编译目录    ./templates_c $smarty->setCompileDir()   $smarty->getCompileDir()
    Smarty默认缓存目录    ./cache     $smarty->setCacheDir()   $smarty->getCacheDir()
    Smarty默认插件目录    ./libs/plugins $smarty->setPluginDir()   $smarty->getPluginDir()
    
    查看Smarty常用目录配置,Smarty类文件的_construct()构造方法

本篇完,还有疑问?留下评论吧

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注