how to get zend studio autocomplete with codeigniter how to get zend studio autocomplete with codeigniter php php

how to get zend studio autocomplete with codeigniter


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.


As Peter's answer instructs, adding an include path is definitely the best way to go. However, this relies on the docblocks in the CI source code to be complete, accurate, and not ambiguous. For example, if a methods @return is declared as Some_Class|false, the autocompletion won't know what to do with it.

To add to Peter's answer, you can also force PDT/Eclipse/ZSfE to treat any variable as an instance of a particular class like so:

/* @var $varName Some_Class_Name */


If you have imported the project from say, like SVN, then you might not have the PHP support enabled for this project. You can enable it by right clicking your project -> configure -> add PHP support...

Tested in ZS 7.2.1