views:

1571

answers:

3

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
Would upvote if not for SO's restrictions. Good work.
mcandre
+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
More flexible than get_class_methods because you can also get parameters and comments.
Kris
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
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