如何用codeigniter Zend Studio的自动完成 [英] how to get zend studio autocomplete with codeigniter
问题描述
我在找一个很好的方式来获得自动完成,点击换引用(不管这就是所谓的)在codeigniter在Zend Studio的工作为Eclipse库。
举例来说,如果我这样做
$这个 - >负载>库('dx_auth');
$这个 - > dx_auth-> get_user_id();
Zend Studio的不知道它是什么。
有本哈克sortof办法做到这一点(见下文,源),但我觉得应该是这样做的更好的方法。
任何人有什么想法?
//所有这些都增加,所以我得到真正的自动完成
//我不担心它导致与部署的任何问题
//因为这个文件不会被调用,因为我在PHP5模式很//核心CI库
$配置=新CI_Config();
$ DB =新CI_DB_active_record();
$电子邮件=新CI_Email();
$ form_validation =新CI_Form_validation();
$输入=新CI_Input();
$负载=新CI_Loader();
$路由器=新CI_Router();
$会话=新CI_Session();
$表=新CI_Table();
$单位=新CI_Unit_test();
$ URI =新CI_URI();
添加CI的库路径作为一个包含路径到你的项目。
- 在 PHP浏览器后,打开您的项目并右键点击包含路径
- 选择配置从上下文菜单
- 然后在包含路径对话框,请选择库标签
- 单击添加外部文件夹...
- 浏览到CI的本地副本,并选择它的库目录(无论它让那些类文件)
- 单击完成
瞧,你去那里!
我要指出,你还可以定义包括在项目创建时的路径。
I'm looking for a good way to get autocomplete and click-for-reference (whatever that's called) for libraries in codeigniter working in Zend Studio for Eclipse.
for instance, if i do $this->load->library('dx_auth'); $this->dx_auth->get_user_id();
zend studio doesn't know what it is..
There is this sortof hacky way to do it (see below, source), but i feel like there should be a better way of doing it..
Anyone have any ideas?
// All of these are added so I get real auto complete
// I don't have to worry about it causing any problems with deployment
// as this file never gets called as I'm in PHP5 mode
// Core CI libraries
$config = new CI_Config();
$db = new CI_DB_active_record();
$email = new CI_Email();
$form_validation = new CI_Form_validation();
$input = new CI_Input();
$load = new CI_Loader();
$router = new CI_Router();
$session = new CI_Session();
$table = new CI_Table();
$unit = new CI_Unit_test();
$uri = new CI_URI();
Add CI's library path as an include path to your project.
- In the PHP Explorer, open your project and right-click on Include Paths
- Select Configure from the context menu
- Then in the include path dialog, select the Library tab
- Click Add External Folder...
- Browse to a local copy of CI and choose it's library directory (wherever it keeps those class files)
- Click Done
Voila, there you go!
I should note that you can also define include paths at the time of project creation.
这篇关于如何用codeigniter Zend Studio的自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!