如何使用codeigniter获得zend studio自动完成 [英] how to get zend studio autocomplete with codeigniter

查看:222
本文介绍了如何使用codeigniter获得zend studio自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个好的方法来获得自动完成和点击参考(任何称为)的代码工作在Eclipse的Zend Studio中的代码库。



例如,如果我做
$ this-> load-> library('dx_auth');
$ this-> dx_auth-> get_user_id();



zend studio不知道是什么。



有这个sortof hacky的方法来做到这一点(见下面,),但我觉得应该有一个更好的方法来做。



任何人都有什么想法?

  //所有这些都添加了所以我得到真正的汽车完成
//我不必担心它导致部署的任何问题
//因为这个文件永远不会被调用,因为我在PHP5模式

//核心CI库
$ 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 中,打开项目并右键单击包含路径

  • 在上下文菜单中选择配置

  • 然后在包含路径对话框中选择 标签

  • 点击添加外部文件夹...

  • 浏览到CI的本地副本,

  • 点击完成

  • Voila,你去!



    我应该注意,你也可以在项目创建时定义包含路径。


    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.

    1. In the PHP Explorer, open your project and right-click on Include Paths
    2. Select Configure from the context menu
    3. Then in the include path dialog, select the Library tab
    4. Click Add External Folder...
    5. Browse to a local copy of CI and choose it's library directory (wherever it keeps those class files)
    6. 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屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆