Welcome Guest, Not a member yet? Register   Sign In
Autocomplete CI 2.0 with Netbeans 6.9.1
#11

[eluser]FC Jeff[/eluser]
Between this:

[quote author="luciobrigido" date="1296842095"][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.[/quote]

This:

[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]

And This:

[quote author="msacket" date="1297152064"]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[/quote]

It's never been better - running NB 7.0.1 on Mac OS 10.7

Thanks for the input people!
#12

[eluser]Unknown[/eluser]
Hi, I just started using CI 2.1.3 and Netbeans 7.2.1. After following the suggested approach I have the autocomplete working on all CI classes. However, it is still not working for classes I derive from CI such as my own controllers, modules, etc. I added some lines to the autocomplete.php to include the new classes to no avail. Below an example of what I added to the autocomplete.php:

* @property ND_user_module $user

So now $this-> includes the ND_user_module user class in the autocomplete but $this->user does not include any of the properties and methods of the ND_user_module class.

What am I doing wrong?

Thanks in advance.




Theme © iAndrew 2016 - Forum software by © MyBB