$outputClass = SGL_FrontController::getOutputClass($input-
>getConfig());
$output = &new $outputClass();
对比一下0.6.1的代码:
$output = &new SGL_Output();
也就是说,在0.6.1中你可能真的是除了修改SGL_Output类是没有别的办法,但是在0.6.2中,SGL的开发都已经为我们想到了这个问题。
你可以使用自己定义的output类,当然最好还是通过继承SGL_Output类然后添加自定义方法。如:
class Output extends SGL_Output
{
function foo()
{
//做你想做的操作了
}
}
当然你还需要在你的全局配置文件中做相关的设置:
$conf['site']['globalJavascriptOnUnload'] = '';
$conf['site']['customOutputClassName'] = '';//在这里真你自定义的输出类名
这也是demian所推荐的方法,只是还没有在SGL文档中说明,SGL的文档也真的应该更新了。好多功能都还没有在手册中体现,我们只能去猜测。