使用 &get_instance() 时如何获得 CI 的完整 Eclipse 代码?
我目前正在使用 Eclipse PDT 和 CodeIgniter,是否可以像这样获得会话库的代码完成:
$CI = &get_instance();
$CI->session->se (No auto-completion here.)
此外,是否有某种插件(或只是一种方法)允许 Eclipse 为所有内容执行此操作我的 CodeIgniter 库。
注意:在大多数情况下,我已经获得了 本教程,但是我正在专门寻找当我使用变量来引用CodeIgniter而不是
$this->
谢谢,
Lemiat
I'm currently using Eclipse PDT and CodeIgniter, is it possible to get code-completion for the sessions library like so:
$CI = &get_instance();
$CI->session->se (No auto-completion here.)
Also, is there some sort of plug-in (or just a method) that would allow eclipse to do this for all my CodeIgniter libraries.
Note: I already have support in most contexts courtesy of this tutorial, however I am looking specifically for when I am using a variable to reference CodeIgniter instead of
$this->
Thanks,
Lemiant
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为人们对此似乎有相当大的兴趣;我想我会分享我对这个问题的解决方案。使用我上面提到的本教程中的方法,您可以使用 PHPDoc 告诉编译器变量是对项目中某个对象的引用。在本例中,我希望 $CI 引用 CI_Base 对象。所以我这样声明我的变量:
瞧,我有完整的代码(注意:你必须使用上面的教程来获得从 $this->CI-> 到其他任何东西的完整代码。)
希望这对某人有帮助,
Lemiat
Since there seems to be a reasonable amount of interest in this; I thought I'd share my solution to this problem. Using the method from this tutorial I mentioned above, you can use PHPDoc to tell the compiler that a variable is a reference to some object in your project. In this case I want $CI to reference the CI_Base object. so I declare my variable like this:
and voila, I have code complete (NOTE: you have to use the tutorial above to get code complete from $this->CI-> to anything else.)
Hope this helps somebody,
Lemiant