Welcome Guest, Not a member yet? Register   Sign In
Model method autocompletion in Netbeans
#1

[eluser]jedd[/eluser]
I've read the various (though they all work on the same principle, usually even the same filename) howtos for getting NetBeans to autocomplete CI stuff, and I've got it working for CI libraries and helpers. But I can't get it to autocomplete methods from my models, while editing (say) a controller.

I'm extending the Model class with MY_Model .. and I suspect this may be confusing things. Has anyone done this successfully? I'm kind of just banging away at different permutations of the 'ci_autocomplete.php' in the ./nbproject directory without really understanding what Netbeans is trying to do with the file .. which probably doesn't help either.
#2

[eluser]n0xie[/eluser]
Try the @property PHPDOC style like this:

Code:
/**
* @property Page_info_model $page_info_model
*/
class Page_info extends MY_Controller {

    function __construct()
    {
        parent::__construct();
        $this->load->model('page_info_model');
    }
}

class Page_info_model extends MY_Model {}

This should result into: screenshot
#3

[eluser]jedd[/eluser]
Thanks n0xie - I'm out of town for a week, so will try this next year and let you know how I go. I'm pretty sure i had that line in my ci_autocomplete.php in my nbproject directory, without any luck though. Will try shifting into model and controller doc blocks ... though hopefujlly it's a stop gap solution.
#4

[eluser]jedd[/eluser]
Okay .. I'm officially bewildered.

I had the @property line, equivalent to what you have shown, in my autocomplete.php (in .../nbproject). I put it into my controller, too, just before the Class definition. But I'm getting no joy when I quit and come back into netbeans - the screen cap you showed just doesn't happen for me - it simply does the 'no suggestions' thing if I force it via ctrl-space.

I'm autoloading my model, but put in a load->model() call in my controller, too, just in case that was what was required by netbeans.

I've tried this on 6.9, 7.0beta and even the 'latest nightly build' from 2010-12-15.

If you have a few minutes, could I please ask a huge favour? One of my projects - a very simple one controller, one model thing - is available at
Code:
git clone git://dingogully.com.au/phoko

I've left the @property line, but removed the load->model() call, from the controller (Album). If you could download this, and just see if you can get NetBeans to properly pick up my model (Kpa) I'd then know if it's me being really dumb, or something weird with my setup. The whole checkout is just under 6MB.
#5

[eluser]n0xie[/eluser]
Hi Jedd,

Sorry I missed your post. I just tried to checkout the repo but it seemed to be 'stuck'. Can you put the file somewhere for me to download?

One thing I did think of: if you are using CI 2.0 you need to change Controller to CI_Controller and Model to CI_Model in the autocomplete file.




Theme © iAndrew 2016 - Forum software by © MyBB