0
在Zend 2 skeleton application,應用程序module.php
包含onBootstrap()
功能:在Zend 2模塊中需要onBootstrap()嗎?
class Module
{
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
}
...
然而,這不是在模塊創建documentation提及。
是否有必要在每個模塊中實現此功能?如果是,爲什麼?它的目的是什麼?
我發現在_one_模塊中使用它通常很好,只要你已經完成了其他模塊上面的默認東西就不需要它了。不幸的是,我不知道它的技術性,但從經驗中我發現一個就足夠了...... – Ankh
http://framework.zend.com/manual/current/en/modules/zend.module-manager.module- class.html http://framework.zend.com/manual/current/en/modules/zend.mvc.examples.html#bootstrapping – newage