[英]Is it possible to use smarty functions outside the smarty template?
如果在php文件中,您有:
$smarty->assign('content','<p>This is some test content</p>');
並在我的模板文件hadb中(僅出於示例目的):
<html>
<head></head>
<body>{$content}{config_load file='settings.conf'}{#setting1#}</body>
</html>
是否可以從配置文件,php文件而不是模板文件中加載設置?
您可以使用config_load()加載配置文件,然后使用get_config_Vars()獲得已加載的值。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.