2

I have started to use NetBeans 6.9.1 for developing PHP projects. Although it does provide code completion to certain extent, but it's by no means complete. For example, commonly used functions such as implode,explode are not in the list for code completion. Also, it would have been convenient to have code completion for objects made from built in classes, such as HttpRequest.

Is there anyway to obtain code completion for the items mentioned above.

Shamim Hafiz
  • 19,616
  • 36
  • 104
  • 164

3 Answers3

1

Try this...

  • Tools->Options
  • Selct "Editor"
  • Select "Code completion"
  • In language drop down select "PHP"

You will see a list of code completion options for PHP project ONLY

  • If you have global variables/objects set "Code Completion for Variables" is set to "All Variables"
  • If you are using methods without static in front of them as static make sure under "Code Completing for Class Methods" you have "Also Non-Static Methods after ::"

If you are not using namespaces PHP 5.3, make sure you project is type is test to PHP 5.2/5.1. To check it, right click your project->Properties->Sources->PHP Version.

Alex
  • 6,201
  • 2
  • 23
  • 26
  • 2
    Actually I needed to declare the project as PHP. What I was doing is opening individual files and not add them to NetBeans project. What you have mentioned is surely of help in case someone needs to change the Editor options. – Shamim Hafiz Sep 07 '10 at 11:48
0

I checked the above thread and my project settings are correct, as are the PHP settings and plugins are enabled. Each PHP editor window shows and editable form, but there is no hints,completion or anything else that is helpful whilst writing code. I figured it out in the end: each PHP section started and ended as below:

<?   ?>

should have been:

<?php    ?>
Yu Hao
  • 111,229
  • 40
  • 211
  • 267
bigal
  • 47
  • 4
0

tags are deprecated (since php 7.0+), but you can enable it in NetBeans if You're working with legacy code at:

Project Properties -> Sources mark Option: Allow short tags, it is also possible to allows ASP tags <% %> there.