Hi! I would like to add my part to the forum.
I got this code completion feature working on NetBeans 7.0.1. As told before, I first created a new folder in the /nbproject folder called CI_Autcomplete. Second, I created a file in it named CI_Autocomplete_2.0.php and copied the coded as shown before:
<?php
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Benchmark $benchmark
...
*/
class CI_Controller {};
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
...
*/
class CI_Model {};
I added the folder to the “Include Path” (right click on the “Include Path” icon, then “Properties”, then add the mentioned folder to the PHP Include Path)
Then I was figuring out how to add code completion for a custom class I used, placed on the application/library folder. After looking and trying, I got the way to do so. Let’s say you have a Foo_class (application/library/Foo_class.php). If you want that class available for code completion in your controller, just add the following:
<?php
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
* @property CI_Benchmark $benchmark
...
* @property Foo_class $foo_class
*/
class CI_Controller {};
/**
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
...
*/
class CI_Model {};
And that’s it! Just document your code and everything will be fine. Hope it helps someone in the community.
(NetBeans 7.0.1, CodeIgniter 2.0.3)