Poru
Poru

Reputation: 8360

Netbeans PHP autocomplete

how could I add an autocomplete for PHP build-in functions like htmlentities or var_dump? The autocompleter work for my classes but there's not autocompletion for functions like mentioned above.

Upvotes: 3

Views: 2003

Answers (2)

Norberto Alves Filho
Norberto Alves Filho

Reputation: 19

Netbeans will surely find all your classes, but only when you declare them explicitly, like this:

    <?php
class example {
   function getData(){
       include("data.php");
       $myData = new data();
       $myData->... will show all your classes.
    }
}

But if you get an object from another class (that's my case) you need to "tell" netbeans what type is that variable:

<?php
class example {
    function getData($myData){ 
    // $myData is an object from class data() instantiated on another part of the code. NetBeans can't know this
    /* @var $myData data */
    $myData->... ///will show methods and properties
    }
}

Upvotes: 0

Thorsten
Thorsten

Reputation: 111

You have to set a "Global Include Path" in Options > PHP > General.

On Mac OS X with MacPorts this should be /opt/local/lib/php, but in the documentation at netbeans.org I didn't find any hints, what to set on other platforms.

Upvotes: 2

Related Questions