PinoyTech.org

CodeIgniter, Kohana, Mootools, jQuery and CSS

Code Completion with Codeigniter using Netbeans

Posted by teejay on June 18, 2009

Most programmers are lazy. If you're like me, you're lazy too. That's why I was so happy about using code completion with CodeIgniter using the Netbeans IDE.

Here's how you'd set it up

/**
 * MY_Model
 *
 * @property CI_DB_active_record $db
 */
class MY_Model extends Model {

With the following code, you can now access the Active Record method and properties using Netbeans codecompletion. You'll just type in $this-> and a list of property shows up including $this->db.

Here's a little explanation.

CI_CD_active_record is the actual class we are accessing. the variable $db is the property you'll be using in the model (in this case).

Take note that you can do this also in the Controller. I highly suggest using a MY_Controller so that you just apply it once.

Another thing is that you'd have to set up a project in Netbeans.

Oh yeah, I have to thank softbas for this.

Categories: How To, Web Development

Tags: codeigniter, php

3 Comments

Aaron

Any idea if this works in Eclipse too?

July 24th 2009

joesem donghil

impressive

October 26th 2009

Thorpe Obazee

@Aaron. I don’t think this works with Eclipse. I can do some research on it and probably show it here.

October 29th 2009

Comments