Welcome Guest, Not a member yet? Register   Sign In
Netbeans 7.0 (final) autocomplete for CI 2.0
#1

[eluser]REK[/eluser]
I was able get autocomplete to work correctly within Netbeans 7.0 (final).

Instructions:

1. Create a new directory inside nbproject (I used this since it's omitted when pushing to prod) with your name of choice, I used "CI_Autocomplete".

2. Create a new file with your name of choice, I used "CI_Autocomplete_2.0.php", and place it inside the newly created folder, "nbproject\CI_Autocomplete".

3. Paste the below code inside the new file, "CI_Autocomplete_2.0.php". File content courtesy of http://ellislab.com/forums/viewthread/180079/.
Code:
<?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
*/

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
*/

class CI_Model {};

?>

4. Now go to (this is for OSX so not sure if it's the same for Windows) File > Project Properties (projectname) > PHP Include Path and include the new folder you created above, nbproject\CI_Autocomplete.

5. Restart your project and autocomplete "should" work.
#2

[eluser]runs.amock[/eluser]
awesome
#3

[eluser]Dennis Rasmussen[/eluser]
Do people ever search the forums or google before posting? This is godly old news.
#4

[eluser]REK[/eluser]
Part of it is old news. The latest version of Netbeans 7.0 just released and the "godly old news" steps were not exactly the same as in 6.9.
#5

[eluser]atno[/eluser]
My netbeans 7.0 supports autocomplete for CI 2.0 out of the box, i didn't need to change or add anything.
#6

[eluser]atno[/eluser]
[quote author="atno" date="1304455427"]My netbeans 7.0 supports autocomplete for CI 2.0 out of the box, i didn't need to change or add anything.[/quote]
nevermind this post Smile
#7

[eluser]William Rufino[/eluser]
you can add your models to the controllers too.... very useful
#8

[eluser]sarim khan[/eluser]
what kind of autocomplete you guys are getting ?
I am using netbeans 7 with codeigniter 2 but not getting so much auto-completion Sad
#9

[eluser]atno[/eluser]
[quote author="sarim khan" date="1304947861"]what kind of autocomplete you guys are getting ?
I am using netbeans 7 with codeigniter 2 but not getting so much auto-completion Sad[/quote]

if would you care to explain what steps did you take we then might be able to help you. "not getting so much auto-completion" aint much of problem description...
#10

[eluser]sarim khan[/eluser]
[quote author="atno" date="1304963333"]
if would you care to explain what steps did you take we then might be able to help you. "not getting so much auto-completion" aint much of problem description...[/quote] I am getting much much autocomplete now, after following this tutorial, but at first i thought that netbeans 7 will support codecomplete out of the box but it wasn't. Tongue


Thank you very much REK. Smile




Theme © iAndrew 2016 - Forum software by © MyBB