Some software you like, you start working with it, and you feel like it’s made for you. Everyday you discover a little bit more of all the hidden powers. That’s the good thing about open source, there is so much power that has yet to be discovered. Most commercial software claim a lot of features in their marketing brochures and disappoint enormously in the end when you start working.
Netbeans 6.5 is good software, out of the box it offers code completion and validation for php, html, css, javascript including jquery, mootools etc.
Code Igniter is a rapid development framework for PHP, it’s a flexible MVC-like system. Netbeans let you easily implements CodeIgniter powers, by offering code completion for CodeIgniter’s native Active record classes, libraries and helpers functions.
You need to set it up though, and here we will explain how:
The first step is only neccesary if you have moved the system folder out of the Netbeans project source folder that contains the application folder, in case of a multi site set up or something.
Add the CodeIgniter System folder to the Netbeans Global Include Path:
Tools>Options>PHP>Add folder to Global Include Path
This will give code completion for the helper functions and some more, but not for the Active record or database functions in a controller.
$this->db->...
To achieve more power, add this to your controller:
/**
* @property CI_Loader $load
* @property CI_Form_validation $form_validation
* @property CI_Input $input
* @property CI_Email $email
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
*/
class Stylist extends Controller
Now you can type
$this->db->...
or
$this->dbforge->...
And you will get all available functions offered. Wow!
To make it really easy, add this to Tools->Options->Editor->Code Templates
-
- New -> abbreviation:
db
- Expanded text: `
$this->db->
`
-
- New -> abbreviation:
`codei`
- Expanded text: `
/**
* @property CI_Loader $load
* @property CI_Form_validation $form_validation
* @property CI_Input $input
* @property CI_Email $email
* @property CI_DB_active_record $db
* @property CI_DB_forge $dbforge
*/
Now you can easily insert the Codeigniter code just above your controller, by typing `codei` and TAB
or db TAB for $this->db->
That rocks, doesn`t it.
See also here and here