如何在 NetBeans 中获取包含文件的建议
我在获取包含文件中包含的类的建议时遇到问题。
例如,文件“Header.php”的内容是:
//File 'Header.php':
include('User.php'); //Class file
当我现在将 Header.php 包含在文件“Example.php”中时,我没有得到任何建议:
//File 'Example.php':
include('Header.php');
User::
输入 User:: 后,我将 User 类的方法和变量作为建议,但没有。如果我将“User.php”直接包含在“Example.php”中,它可以工作,但这对我没有帮助。如何解决这个问题呢?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对我来说效果很好,但所有文件都必须包含在项目文件中。您不能只打开随机文件并包含它们。另外,如果出现延迟,请尝试按 Crtl+Space。
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.
您可以使用static关键字在类中声明您的方法和变量。然后 Netbeans(肯定是在 NB 6.9.1 中)将显示类似 ClassName::... 的建议
但这一解决方案并不适用于所有情况......
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...