Zend Framework - 在application / Bootstrap中加载模块

时间:2012-04-24 07:59:49

标签: zend-framework

application
|-Payment
| | +--Item
| |   +---Footer.php
| +--Manager.php
|-Boostrap.php

在application / Boostrap.php中我想要启动付款模块,如下所示:

protected function _initPaymentManager()
{
    $manager = Payment_Manager::getInstance();  
    $manager->registerHandler(new Payment_Item_Footer());   
}

但框架尚未加载Payment模块。如何调用application / Bootstrap.php中的Payment模块中的类?

1 个答案:

答案 0 :(得分:1)

要确保首先加载模块资源,请添加:

$this->bootstrap('modules');

_initPaymentManager方法的开头。

您还需要Bootstrap.php文件夹中的application/Payment/