CodeIgniter Forums
Autocomplete CI 2.0 with Netbeans 6.9.1 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Autocomplete CI 2.0 with Netbeans 6.9.1 (/showthread.php?tid=38255)

Pages: 1 2


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 02-03-2011

[eluser]luciobrigido[/eluser]
hi, i was using autocomplete with CI 1.7.3, but now I upgraded to CI 2.0 and it's getting some errors with variable $this, in all my Controllers (http://rhasan.com/blog/2009/09/codeigniter-auto-complete-with-netbeans/).

I changed "Controller" to "CI_Controller" and it didn't worked anymore.

did it happen to you too? any workaround?

c ya thanks.


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 02-03-2011

[eluser]luciobrigido[/eluser]
ops my mistake. coding problems solved. it worked again.


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 02-03-2011

[eluser]Renji NsK[/eluser]
[quote author="luciobrigido" date="1296755311"]ops my mistake. coding problems solved. it worked again.[/quote]

How did you manage the autocomplete ?
I got NetBeans 7 and CI_2.0, i placed the file described at the webpage you linked inside nbproject folder of my project...
at the "Tools-> Options-> PHP-> General" my Global include path it's set to point at the location of the CodeIgniter root folder.
(i also got one to point at codeigniter/system)

Still.. when i type, let's say:
$this->load->... i dont get the "hints" pop-up at all... even when i press
CTRL+Space i get "No Suggestions"..

Ergh.. mind my bad English, it's not my native language.


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 02-04-2011

[eluser]luciobrigido[/eluser]
[quote author="Renji NsK" date="1296792538"][quote author="luciobrigido" date="1296755311"]ops my mistake. coding problems solved. it worked again.[/quote]

How did you manage the autocomplete ?
I got NetBeans 7 and CI_2.0, i placed the file described at the webpage you linked inside nbproject folder of my project...
at the "Tools-> Options-> PHP-> General" my Global include path it's set to point at the location of the CodeIgniter root folder.
(i also got one to point at codeigniter/system)

Still.. when i type, let's say:
$this->load->... i dont get the "hints" pop-up at all... even when i press
CTRL+Space i get "No Suggestions"..

Ergh.. mind my bad English, it's not my native language.[/quote]

hi Renji.

this is my configuration:
- netbeans 6.9.1
- CI 2.0
--------------
what do i have:
- autocomplete in my controllers (folder: application/controllers)
- autocomplete in my models (folder: application/models)

what i don't have:
- autocomplete in my views

but if you look at the .php file for autocomplete, it shows you what classes it will accept autocomplete (class CI_Controller {}; and class CI_Model {}Wink. but views don't extend any classes (I guess), so it can't make use of such trick.

i have my file named 'netbeans_ci_code_completion.php' (but it can have any name) and is posted inside folder 'nbproject', along with other files (project.xml, project.properties etc). use Windows Explorer to do this, because Netbeans may add an extra '.php' to your filename!

in my system i have many versions of CI (1.7, 2.0), so I don't add it to GLOBAL PATH. i just add it to PATH INSIDE PROJECT ('add path'), so I include 'codeigniter2.0/application/' path for each project. this tend to be more work, but I don't want any problems with different versions!

then restart your Netbeans. this should solve your problem. mine only worked after a Netbeans restart.

hope this helps you, if not please continue msging.

this is my file:
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 {};


?>

c ya.


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 02-04-2011

[eluser]Renji NsK[/eluser]
yay!
I overwriten my own file with the one you posted inside the code
and everything works fine!

Well, it works with NetBeans 6.9.1 but not with NetBeans 7 Beta.
Don't realy know the reason...

anyways, what was wrong?
the spelling inside the file of the nbproject folder.
i had
Code:
class Controler {}
...
...
...
class Model {}

i was missing the CI_ prefix...

Thanks alot mate! Smile


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 02-06-2011

[eluser]dougiebear[/eluser]
Many thanks for the auto complete suggestion - it works a treat on Zend Studio 8.


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 02-07-2011

[eluser]Unknown[/eluser]
Here's how to get auto-complete working with NetBeans 6.9.1 and your CI views. Additionally, this adds some clarification to what your view's can expect to have with regards to available variables.

Simply insert something like the following at the top of your view:

Code:
<?php
/* @var $this CI_Controller */
/* @var $user AwUser */
/* @var $room AwRoom */
?>

That's it. One thing to note is that it doesn't appear to work to wrap all of your declarations within a single comment.

Enjoy!
Michael


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 04-16-2011

[eluser]Crag[/eluser]
Thanks luciobrigido, helped me a lot.


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 05-02-2011

[eluser]REK[/eluser]
I was able to get autocomplete working for Netbeans 7.0 (final) in OSX. I created the file as stated above, but placed the file in a new empty folder (I named it "autocomplete") inside nbproject folder. Then in "File > Project Properties (projectname) > PHP Include Path" I added the newly created folder "autocomplete" path.


Autocomplete CI 2.0 with Netbeans 6.9.1 - El Forum - 07-17-2011

[eluser]arcreative[/eluser]
[quote author="REK" date="1304411048"]I was able to get autocomplete working for Netbeans 7.0 (final) in OSX. I created the file as stated above, but placed the file in a new empty folder (I named it "autocomplete") inside nbproject folder. Then in "File > Project Properties (projectname) > PHP Include Path" I added the newly created folder "autocomplete" path.[/quote]

That. Is. AWESOME. I always said "welllll, CI is so light that you don't need completion," but now I can admit that I was just being stubborn :-)

Thanks for this!