简体   繁体   中英

How to get code completion to work for PHP in Netbeans?

How to get code completion to work for PHP in Netbeans 6.9.1? I want Netbeans to suggest native PHP functions.

替代文字

EDIT:

The auto complete only works for reserved vars and reserved keywords but not for native functions. Looking at the example above, it should suggest eg str_replace, strlen, etc...that doesnt happen even after CTRL + SPC.

Just make sure you have enabled the PHP plugin, that should do the trick. BTW autocomplete might not work while NetBeans is checking for project changes though...

This happened to me from time to time when I used NetBeans. I used the CTRL+SPACE shortcut to invoke the code completion window.

UPDATE:
If you're interested, you can also use VIM, which has a code completion feature for php as well.

Assuming you have VIM 7 (Full version) installed, add the following to your .vimrc file:

autocmd FileType php set omnifunc=phpcomplete#CompletePHP

To use the code completion window, simply use CTRL+X CTRL+O

Install NetBeans with PHP support. OR if you already have netbeans, you need to install PHP plugin by going to Plugins Manager.

If you want code completion for external libraries like Zend, add them in the Gobal Include Path (available in project properties)

显然,删除了用户目录中的.netbeans / var / cache / index内容(Windows等应用程序数据)已将其修复。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM