我正在寻找一种好方法来为在 Zend Studio for Eclipse 中工作的 codeigniter 中的库获取自动完成和点击引用(无论叫什么)。
例如,如果我这样做 $this->load->library('dx_auth'); $this->dx_auth->get_user_id();
zend studio 不知道它是什么..
有这种 hacky 方法(见下文,source),但我觉得应该有更好的方法..
有人有什么想法吗?
// 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();
最佳答案
将 CI 的库路径添加为项目的包含路径。
- 在 PHP Explorer 中,打开您的项目并右键点击 Include Paths
- 从上下文菜单中选择配置
- 然后在包含路径对话框中,选择库标签
- 点击添加外部文件夹...
- 浏览到 CI 的本地副本并选择它的库目录(保存这些类文件的位置)
- 点击完成
瞧,好了!
请注意,您还可以在创建项目时定义包含路径。
关于php - 如何使用 codeigniter 使 zend studio 自动完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1080068/