模块引导程序不工作
我有一个人员模块,这是我的引导程序:
application/modules/person/Bootstrap.php
class Person_Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initAutoload() {
$personLoader = new Zend_Loader_Autoloader_Resource( array (
'basePath' => APPLICATION_PATH . '/modules/person',
'namespace' => 'Person',
'resourceTypes' => array (
'form' => array ( 'path' => 'forms/', 'namespace' => 'Form_' ),
'model' => array ( 'path' => 'models/', 'namespace' => 'Model_' )
);
));
return $personLoader ;
}
} // end class
但是每当我进入该模块的任何控制器/操作时,它都不会考虑此引导程序。因此我无法访问此模块中的表单,例如:
class Person_Form_MyForm extends Zend_Form {
// elements
}
I have a Person Module and here is my bootstrap:
application/modules/person/Bootstrap.php
class Person_Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initAutoload() {
$personLoader = new Zend_Loader_Autoloader_Resource( array (
'basePath' => APPLICATION_PATH . '/modules/person',
'namespace' => 'Person',
'resourceTypes' => array (
'form' => array ( 'path' => 'forms/', 'namespace' => 'Form_' ),
'model' => array ( 'path' => 'models/', 'namespace' => 'Model_' )
);
));
return $personLoader ;
}
} // end class
But whenever I go to any controller/action of this module, it is not considering this bootstrap. Therefore I am unable to access forms in this module like:
class Person_Form_MyForm extends Zend_Form {
// elements
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Zend_Application_Bootstrap_Bootstrap
用于您的应用程序Bootstrap
,它进入application/Bootstrap.php
创建模块引导程序时,您应该扩展
Zend_Application_Module_Bootstrap< /代码> 类。
Zend_Application_Bootstrap_Bootstrap
is for your applicationBootstrap
, which goes intoapplication/Bootstrap.php
When creating a module bootstrap, you should extend
Zend_Application_Module_Bootstrap
class.