How can I see in Netbeans, which methods an object knows?
I'm using NetBeans and PHP. For example, I insert this code:
<?p开发者_如何学运维hp
try {
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
foreach($dbh->query('SELECT * from FOO') as $row) {
print_r($row);
}
$dbh = null;
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
Now, when I hover my mouse over the $dbh symbol, I get no information about it. Other IDEs tell me which methods an object understands. I'm sure NetBeans can do the same. How?
Write $dbh->
and a list of functions should come up automatically. If not, press ctrl+space
Also, see this about helping netbeans with function return types and class members.
You can also edit the settings for the Code Completion feature in the Editor->Code Completion
section of the Options window. You can modify how/when the list pops up.
精彩评论