CodeIgniter Autocomplete for Komodo Edit

Komodo Edit is a great cross-platform, free IDE and editor. However native autocomplete doesn’t work when working with CodeIgniter. Adding the path to the CodeIgniter folder also doesn’t seem to solve the problem.

While searching over the internet, I got some clues of how to achieve it. All you have to do is create a file and name it autocomplete.php (you can name it whatever you like) and copy/paste the following into it:

<?php
/**
 * @property CI_DB_active_record $db
 * @property CI_DB_forge $dbforge
 * @property CI_Benchmark $benchmark
 * @property CI_Calendar $calendar
 * @property CI_Cart $cart
 * @property CI_Config $config
 * @property CI_Controller $controller
 * @property CI_Email $email
 * @property CI_Encrypt $encrypt
 * @property CI_Exceptions $exceptions
 * @property CI_Form_validation $form_validation
 * @property CI_Ftp $ftp
 * @property CI_Hooks $hooks
 * @property CI_Image_lib $image_lib
 * @property CI_Input $input
 * @property CI_Language $language
 * @property CI_Loader $load
 * @property CI_Log $log
 * @property CI_Model $model
 * @property CI_Output $output
 * @property CI_Pagination $pagination
 * @property CI_Parser $parser
 * @property CI_Profiler $profiler
 * @property CI_Router $router
 * @property CI_Session $session
 * @property CI_Sha1 $sha1
 * @property CI_Table $table
 * @property CI_Trackback $trackback
 * @property CI_Typography $typography
 * @property CI_Unit_test $unit_test
 * @property CI_Upload $upload
 * @property CI_URI $uri
 * @property CI_User_agent $user_agent
 * @property CI_Validation $validation
 * @property CI_Xmlrpc $xmlrpc
 * @property CI_Xmlrpcs $xmlrpcs
 * @property CI_Zip $zip
 * 
 * Add addtional libraries you wish
 * to use in your controllers here
 * 
 */
class CI_Controller {};

/**
 * @property CI_DB_active_record $db
 * @property CI_DB_forge $dbforge
 * @property CI_Config $config
 * @property CI_Loader $load
 * @property CI_Session $session
 *
 * Add addtional libraries you wish
 * to use in your models here.
 * 
 */
class CI_Model {};
?>

Save the file and now open Komodo Edit. From the menu, open Edit and select Preferences option. A dialog window will appear. From the Category on the left side, select Languages and then further select PHP option (as shown in the picture below):

CodeIgniter Autocomplete for Komodo Edit

CodeIgniter Autocomplete for Komodo Edit

Add the directory which contains the newly created autocomplete.php file to the section PHP Directories and restart Komodo.

This should be enough for the autocomplete!

Advertisements

8 thoughts on “CodeIgniter Autocomplete for Komodo Edit

  1. Can you please explain how to properly include a model or controller in this file?
    For example, we have a model called mymodel with the following functions:
    function1
    function2
    etc..
    How would you add these to the autocomplete.php file?

  2. Thanks for the file, it’s pretty good… although to be honest it’s only 1/2 useful without loading methods from my own models.

    In either case, it’s still better than before so THANKS!! 🙂

  3. Inside the System\code\Controller.php file, right after the :
    @link http://codeigniter.com/user_guide/general/controllers.html
    i added all the default properties:
    * @property CI_DB_active_record $db
    * @property CI_DB_forge $dbforge
    * @property CI_Benchmark $benchmark
    * @property CI_Calendar $calendar
    * @property CI_Cart $cart
    * @property CI_Config $config
    * @property CI_Controller $controller
    * @property CI_Email $email
    * @property CI_Encrypt $encrypt
    * @property CI_Exceptions $exceptions
    * @property CI_Form_validation $form_validation
    * @property CI_Ftp $ftp
    * @property CI_Hooks $hooks
    * @property CI_Image_lib $image_lib
    * @property CI_Input $input
    * @property CI_Language $language
    * @property CI_Loader $load
    * @property CI_Log $log
    * @property CI_Model $model
    * @property CI_Output $output
    * @property CI_Pagination $pagination
    * @property CI_Parser $parser
    * @property CI_Profiler $profiler
    * @property CI_Router $router
    * @property CI_Session $session
    * @property CI_Sha1 $sha1
    * @property CI_Table $table
    * @property CI_Trackback $trackback
    * @property CI_Typography $typography
    * @property CI_Unit_test $unit_test
    * @property CI_Upload $upload
    * @property CI_URI $uri
    * @property CI_User_agent $user_agent
    * @property CI_Validation $validation
    * @property CI_Xmlrpc $xmlrpc
    * @property CI_Xmlrpcs $xmlrpcs
    * @property CI_Zip $zip
    and in the end my own models, for example, i have a model called Mydb so i added:
    * @property Mydb $mydb

    Please not that i use Komodo IDE 8

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s