Thursday, July 15, 2010

using codeigniter autocomplete in eclipse helios

UPDATE FOR CODEIGNITER 2


Paste the codes in /system/core/controller.php and /system/core/model.php instead.


I was able to get my eclipse autocomplete for codeignite in these two steps.

I use eclipse helios and codeigniter 1.7.2 and php5
  1. Create a new eclipse php project, choose project at existing location and choose path/to/codeigniter/system. I mean path to the codeigniter folder.
  2. edit codeigniter/Base4.php
    and insert the following before the constructor
            /**
    * @var CI_Config
    */
    var $config;
    /**
    * @var CI_DB_active_record
    */
    var $db;
    /**
    * @var CI_Email
    */
    var $email;
    /**
    * @var CI_Form_validation
    */
    var $form_validation;
    /**
    * @var CI_Input
    */
    var $input;
    /**
    * @var CI_Loader
    */
    var $load;
    /**
    * @var CI_Router
    */
    var $router;
    /**
    * @var CI_Session
    */
    var $session;
    /**
    * @var CI_Table
    */
    var $table;
    /**
    * @var CI_Unit_test
    */
    var $unit;
    /**
    * @var CI_URI
    */
    var $uri;
    /**
    * @var CI_Pagination
    */
    var $pagination;

Save it and you're done. Try using the autocomplete and if it doesn't show, force it by pressing Ctrl-Space.