문제

I have a Model which I would like to use all variables in a drop down lis on a form.

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

I was hoping, something like this would work, but it doesn't

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

Calling this returns this fatal error:

Fatal error: Call to undefined function getclass_methods()

What I want to achieve is an automatically updated form options when I update the model (which, could be quite frequently)

I might have answered my own question, in that I would build an array in the model that returns upon a call... but if there is already a method that can do this, then it would be much appreciated.

Thank you in advance.

도움이 되었습니까?

해결책

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

다른 팁

The function is get_class_methods, not getclass_methods (missing an '_')

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top