ahm*_*n86 3 bootstrapping zend-framework
我发现在Zend Framework应用程序中的Bootstrap类中使用了许多函数,例如:
_initRoute()
_initLocale()
_initLayout()
.......
Run Code Online (Sandbox Code Playgroud)
但我搜索它的参考,但我什么都不喜欢
Zend_Application_Bootstrap_BootstrapAbstract
Zend_Application_Bootstrap_Bootstrap
Run Code Online (Sandbox Code Playgroud)
它们都不包含任何这些功能.
我在哪里可以找到这些功能的完整参考?
基本上,这些是位于的资源插件library/Zend/Application/Resource/.您也可以创建自定义的.
另见,见BootstrapAbstract.php:
/**
* Get class resources (as resource/method pairs)
*
* Uses get_class_methods() by default, reflection on prior to 5.2.6,
* as a bug prevents the usage of get_class_methods() there.
*
* @return array
*/
public function getClassResources()
{
if (null === $this->_classResources) {
if (version_compare(PHP_VERSION, '5.2.6') === -1) {
$class = new ReflectionObject($this);
$classMethods = $class->getMethods();
$methodNames = array();
foreach ($classMethods as $method) {
$methodNames[] = $method->getName();
}
} else {
$methodNames = get_class_methods($this);
}
$this->_classResources = array();
foreach ($methodNames as $method) {
if (5 < strlen($method) && '_init' === substr($method, 0, 5)) {
$this->_classResources[strtolower(substr($method, 5))] = $method;
}
}
}
return $this->_classResources;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1638 次 |
| 最近记录: |