开发者

Netbeans PHP autocomplete

how could I add an autocomplete for PHP build-in functions like htmlentities or var_dum开发者_运维百科p? The autocompleter work for my classes but there's not autocompletion for functions like mentioned above.


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.


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
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜