Autocomplete in Codeigniter 2.1.0 and Eclipse pdt

I have recently started working with Codeigniter for a few side projects and to help me stay up to date with php. I am using eclipse pdt as my ide. In order to get auto complete to work it is quite simple. (Note, these steps are the exact same for Aptana. Just adding a user library…)

  • Download the 2.1.0 files to an easy to find location as you will be referencing it for multiple projects.
  • Modify /system/core/controller.php and /system/core/model.php with the code changes listed below
  • In your actual Codeigniter project, add a new user library (/preferences) and point it to the 2.1.0 files and folders
  • Now you should have auto complete for all your CI methods!

    Code Changes:

    //Put this code right before: class CI_Model { ...
    /**
      * @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;

    (The code is from this post here)

    Leave a Reply