I'm working with Views 2 in Drupal 6, and I am having difficulty finding documentation on the methods of the View object. Is there any PHP function like print_r that outputs methods as well as fields?
+11
A:
I believe you're looking for get_class_methods. If this is the case, get_class_vars may also interest you.
Mathachew
2009-08-17 20:06:25
Would upvote if not for SO's restrictions. Good work.
mcandre
2009-08-17 20:07:47
+4
A:
The Reflection API might be of interest to you (if it's not overkill). Specifically:-
<?php
Reflection::export(new ReflectionClass('View'));
?>
Check out the manual for more in-depth examples.
Gavin Gilmour
2009-08-17 20:09:28
More flexible than get_class_methods because you can also get parameters and comments.
Kris
2009-08-17 20:23:16
Also handy: `get_class($object);`When you're dealing with a generated object from a generated class, you can pass this in to the ReflectionClass constructor.See http://php.net/manual/en/function.get-class.php
Dan
2010-07-02 19:02:57
A:
Besides the functions mentioned by Mathachew you can also take a look at Reflection, especially the ReflectionClass
class.
$class = new ReflectionClass('YourViewClass');
$class->getMethods();
$class->getProperties();
Philippe Gerber
2009-08-17 20:13:27