| Method | Return Value | Parameters | Description |
|---|---|---|---|
| __construct( $application ) | Void |
| 构造方法。接受一个参数,参数要求是一个Zend_Application对象,或另一个引导对象。 |
| setOptions( array $options) | Zend_Application_Bootstrap_Bootstrapper |
| 通常情况下, 选项都可以匹配映射到对应的setter;否则,选项仅仅会被存储,便于以后查找 |
| getApplication() | Zend_Application |Zend_Application_Bootstrap_Bootstrapper | N/A | 获取application实例 |
| getEnvironment() | String | N/A | 获取environment |
| getClassResources() | Array | N/A | 获取可以可用的资源 |
| bootstrap($resource = null) | Mixed |
| 如果 $resource为空,注册所有资源.如果为字符串注册指定的资源;如果是数组, 只注册指定的资源. |
| run() | Void | N/A | 执行引导. |
| Method | Return Value | Parameters | Description |
|---|---|---|---|
| registerPluginResource($resource, $options = null) | Zend_Application_Bootstrap_ResourceBootstrapper |
| 用于注册资源类,通过可选选项传递资源 |
| unregisterPluginResource($resource) | Zend_Application_Bootstrap_ResourceBootstrapper |
| 删除插件资源 |
| hasPluginResource($resource) | Boolean |
| |
| getPluginResource($resource) | Zend_Application_Resource_Resource |
| |
| getPluginResourceNames() | Array | N/A | |
| setPluginLoader(Zend_Loader_PluginLoader_Interface $loader) | Zend_Application_Bootstrap_ResourceBootstrapper |
| |
| getPluginLoader() | Zend_Loader_PluginLoader_Interface | N/A |
| Method | Return Value | Parameters | Description |
|---|---|---|---|
| __construct($application) | Void |
| Accepts either a Zend_Application or a Zend_Application_Bootstrap_Bootstrapper object as the sole argument. |
| setOptions(array $options) | Zend_Application_Bootstrap_Bootstrapper |
| 所有选项都可以映射到选项指定的setter, 否则,该选项将只是被存储供以后查找 例如,如果在扩展类中定义一个setFoo() 方法,可以通过foo选项传递值 |
| getOptions() | Array | N/A | |
| hasOption($key) | Boolean |
| |
| getOption($key) | Mixed |
| 不存在返回 NULL |
| setApplication(Zend_Application | Zend_Application_Bootstrap_Bootstrapper $application) | Zend_Application_Bootstrap_BootstrapAbstract |
| |
| getApplication() | Zend_Application |Zend_Application_Bootstrap_Bootstrapper | N/A | |
| getEnvironment() | String | N/A | |
| getClassResources() | Array | N/A | |
| getContainer() | Object | N/A | 获取存储资源的容器。如果没有容器,可以通过Zend_Registry注册,然后返回一个Zend_Registry实例。 |
| setContainer($container) | Zend_Application_Bootstrap_BootstrapAbstract |
| |
| hasResource($name) | Boolean |
| |
| getResource($name) | Mixed |
| |
| bootstrap($resource = null) | Mixed |
| 如果 $resource为空,注册所有资源.如果为字符串注册指定的资源;如果是数组, 只注册指定的资源. |
| run() | Void | N/A | |
| __call($method, $args) | Mixed |
| 为了方便可以用"bootstrap<ResourceName>()"代替 bootstrap() 引导注册资源。 |
appnamespace = "Application"Or in XML:
<appnamespace>Application</appnamespace>默认情况下,Zend_Tool提供“Application”命名空间。
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap{ protected $_appNamespace = "Application";}更多关于zend相关内容感兴趣的读者可查看本站专题:《Zend FrameWork框架入门教程》、《php优秀开发框架总结》、《Yii框架入门及常用技巧总结》、《ThinkPHP入门教程》、《php面向对象程序设计入门教程》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》