gpt4 book ai didi

php - 如何使用 codeigniter 使 zend studio 自动完成

转载 作者:可可西里 更新时间:2023-10-31 23:09:46 24 4
gpt4 key购买 nike

我正在寻找一种好方法来为在 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 的库路径添加为项目的包含路径。

  1. PHP Explorer 中,打开您的项目并右键点击 Include Paths
  2. 从上下文菜单中选择配置
  3. 然后在包含路径对话框中,选择标签
  4. 点击添加外部文件夹...
  5. 浏览到 CI 的本地副本并选择它的库目录(保存这些类文件的位置)
  6. 点击完成

瞧,好了!

请注意,您还可以在创建项目时定义包含路径。

关于php - 如何使用 codeigniter 使 zend studio 自动完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1080068/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com