Zend framework 如何在初始化之前初始化每个父方法?

Zend framework 如何在初始化之前初始化每个父方法?,zend-framework,Zend Framework,我有一个自定义的引导类,我正在扩展它 class Bootstrap extends MyBootstrap { } php类有一些_init方法。我需要它先加载我所有的引导方法。如何?在引导类中尝试以下操作: $methods = get_class_methods ('MyBootstrap'); foreach ($methods AS $method) { if (str_pos ($method, '_init') !== false) { call_use

我有一个自定义的引导类,我正在扩展它

class Bootstrap extends MyBootstrap
{

}

php类有一些_init方法。我需要它先加载我所有的引导方法。如何?

在引导类中尝试以下操作:

$methods = get_class_methods ('MyBootstrap');
foreach ($methods AS $method) {
    if (str_pos ($method, '_init') !== false) {
        call_user_func (array ($this, $method));
    }
}

获取类方法-返回类方法的名称。然后查找类似“\u init”的方法并运行它们。

在引导类中尝试类似的方法:

$methods = get_class_methods ('MyBootstrap');
foreach ($methods AS $method) {
    if (str_pos ($method, '_init') !== false) {
        call_user_func (array ($this, $method));
    }
}

获取类方法-返回类方法的名称。然后寻找像“\u init”这样的方法并运行它们。

难道没有更一致的方法吗?我什么都不知道。唯一的另一种方法是手动调用每个方法,但我想这不是您想要的。是否有更一致的方法?我不知道。唯一的另一种方法是手动调用每个方法,但我想这不是您想要的。