How to get suggestions in NetBeans for included fi

2019-05-30 17:12发布

i have a problem to get suggestions for classes which are included in included files.

E.g. content of file 'Header.php' is:

//File 'Header.php':
include('User.php'); //Class file

When I now include the Header.php in my file 'Example.php', i do not get any suggestions:

//File 'Example.php':
include('Header.php');
User::

After typing User:: I exspect Methods and Vars of class User as suggestions, but there arent any. If I would include 'User.php' directly in my 'Example.php' it works, but that doesn't help me. How to solve this problem?

2条回答
狗以群分
2楼-- · 2019-05-30 17:28

This works fine for me, but all the files have to be included in a Project file. You can't just open random files and include them. Also, if it's lagging, try pressing Crtl+Space.

查看更多
虎瘦雄心在
3楼-- · 2019-05-30 17:52

You can use static keyword to declare your methods and vars in class. Then Netbeans (definitely in NB 6.9.1) will show suggestions like ClassName::... But this one solution is not for all cases...

查看更多
登录 后发表回答