我需要在smarty中添加一个报告页面。我需要创建一个外部页面来获取报告。如何在外部页面中获得智能预定义变量,数据库配置文件和类文件。任何人都可以提前帮助,谢谢。
答案 0 :(得分:0)
您需要通过
为外部说somefile.php
文件添加smarty类
include('Smarty.class.php');
$smarty = new Smarty;
// your declarations here
//your db connection and get your predefined variable using include
$smarty->display('somefile.tpl');
在somefile.tpl
文件中,您将通过{$declared variable}
因此,无论何时运行somefile.php文件,您都可以获取其中的值。