且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

引导后访问 Zend 应用程序引导 _init 函数

更新时间:2023-12-03 09:50:58

Zend_Controller_Front 是单例的,但它的构造函数是受保护的,所以你可以简单地通过创建一个名为 App_Controller_Front 的类来扩展它

Zend_Controller_Front is singleton, but its constructor is protected, so you can extend that simply by creating a class called, App_Controller_Front

在其中为 getNewInstance() 创建一个方法,该方法可以调用构造函数而无需检查是否存在.这样你就可以覆盖单例行为.

in that create a method for getNewInstance(), which can call constructor without checking for existence. This way you can override the singleton behavior.