Welcome Guest, Not a member yet? Register   Sign In
Load a model and get the object
#1

[eluser]Unknown[/eluser]
Hi,


I'm using Netbeans with CI and I found this really annoying: when loading a model:
Code:
$this->load->model('some_model');
is there a way to get the available methods of the model?

In Netbeans CTRL+Space shows a list of available, but when I do
Code:
$this->some_model->CTRL+Space
theres nothing that tells me what methods are in the model.

If I want the list I have to do
Code:
$Some_var = new Some_moddel();
Is there a way to avoid that line every time I load a model?

Thank you
#2

[eluser]TheFuzzy0ne[/eluser]
I'm not entirely sure, to be honest. Netbeans tries to intelligently guess what methods belong to what objects, but I think CodeIgniter confuses it.

With:
Code:
$some_var = new Some_model();

Netbeans knows exactly what that variable contains, and knows what methods are available for that object.

However, CodeIgniter uses a loader, and I don't think Netbeans knows when a model is loaded, or even if it has been loaded.

This might help: http://ellislab.com/forums/viewthread/187949/

You may be able to add your models as properties.

Code:
/**
* @property Some_model $some_model
*/




Theme © iAndrew 2016 - Forum software by © MyBB