在Application.cfc
admin 子目录中,扩展父目录中的那个,例如:
component extends="ApplicationProxy" {
// eg: if you need to do something different in the local onApplicationStart:
public void function onApplicactionStart(){
super.onApplicationStart();
// stuff that's different from the parent goes here
}
// if there's nothing different for a given handler, then don't have one in here: the super one will still fire
// otherwise override each handler in a similar fashion to the onApplicationStart above, with:
// a) a call to its super equivalent
// b) anything that needs overriding
}
在您的基本目录中,添加ApplicationProxy.cfc
,因此:
component extends="Application" {
}
这样做的原因是 subApplication.cfc
不能有extends="Application"
,因为这看起来像是一个循环引用。但是,没有更好的“合格”方式来识别基本目录中的 Application.cfc,因此需要一个代理。