Aptana autocomplete feature for php's build-in function and custom functions in your project is working out of the box. Just type the part of function name, and then press Ctrl+Space
. A list of functions will displayed, and if there are only 1 function with that name, the full function name will automatically written.
However, since CI load the library and model using $this->load()
method, Aptana will not recognize the methods in the library and models. To make Aptana recognize library's and model's methods, add these comments:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
*
* @author donny
* @property CI_Loader $load
* @property CI_Input $input
* @property CI_Output $output
* @property CI_Email $email
* @property CI_Form_validation $form_validation
* @property CI_URI $uri
* @property Firephp $firephp
* @property ADOConnection $adodb
* @property Content_model $content_model
*/
class Content extends MY_Controller {
function Content()
{
parent::MY_Controller();
//load model
$this->load->model('content_model');
//...
}
/**
*
* @return void
* @access public
*/
function index()
{
//...
}
}
In code snipped above, when I type $this->input->
then press Ctrl+Space
, a list of methods from Input
library will be displayed. The key to do this is the comment with this line:
* @property CI_Input $input
This will tell Aptana that in my controller, the $this->input->
is actually an object of the CI_Input
class. You can do this for models too. Just write the actual class name, and the name inside the controller, and Aptana will recognize and use it, like this:
* @property Content_model $content_model
I use Aptana and I don't set much. I just set the tab into space with 2 space, install git plugins and jquery support, tweak the shortcut, add php templates that I always use, and I'm ready to go. I try to keep the change minimum, so when I had to use other computer with fresh installed Aptana, I don't have to do re-setting too much. Just do some mandator setting and I can use it right away.
I hope this simple trick work for you.