Zend Framework,从模型中返回类方法

时间:2013-01-28 11:24:26

标签: php zend-framework zend-form zend-framework-modules

我有一个模型,我想在表格的下拉列表中使用所有变量。

protected $_scheduledTime;
protected $_isLive;
protected $_isQueued;
protected $_url;

我希望,像这样的东西可行,但它不会

public function getMethods() {
    $methods = getclass_methods($this);
    return $methods;
}

调用此方法会返回此致命错误:

致命错误:调用未定义的函数getclass_methods()

我想要实现的是在更新模型时自动更新的表单选项(可能非常频繁)

我可能已经回答了我自己的问题,因为我会在模型中构建一个在调用时返回的数组......但是如果已经有一个方法可以做到这一点,那么我将非常感激。

提前谢谢。

2 个答案:

答案 0 :(得分:2)

get_declared_classes() // gives you all declared classes
get_class_methods() // gives you all methods of class
get_class_vars() // gives you properties of the class
get_object_vars() // gives you propertis of an object
get_parent_class()  // gives you parent class of the current class

答案 1 :(得分:1)

函数是get_class_methods,而不是getclass_methods(缺少'_')