Skip to main content

Code Completion in Aptana Studio 3 for CodeIgniter 2

If you don't know code completion in Aptana Studio 3/ Eclipse for CodeIgniter 2 is very easy.

Only thing required is to put following code in any new file in CodeIgniter project directory.

It’s just a class in which all the codeigniter library clasees are initialized.

You can even add support for custom classes by initializing it as shown.
[php]
<?php

class _
{
function _()
{

// any classes you want included in autocompletion
$this->load = new CI_Loader();
$this->config = new CI_Config();
$this->email = new CI_Email();
$this->encrypt = new CI_Encrypt();
$this->pagination = new CI_Pagination;
$this->session = new CI_Session();
$this->driver = new CI_Driver();
$this->benchmark = new CI_Benchmark();
$this->typography = new CI_Typography();
$this->form_validation = new CI_Form_validation();
$this->profiler = new CI_Profiler();
$this->image_lib = new CI_Image_lib();
$this->math = new Math();
$this->calendar = new CI_Calendar();
$this->db = new CI_DB_active_record();
$this->table = new CI_Table();
$this->table = new MY_Table();
$this->ftp = new CI_FTP();
$this->output = new CI_Output();
$this->javascript = new CI_Javascript();

// note you'll need to use $this->CI = & getInstance() in extended libs
// in order for the CI to autocomplete
$this->CI=new CI_Controller();

$this->page_m = new Page_m();

}

}

// any classes you want autocomplete for
class CI_Controller extends _ {}
class CI_Model extends _ {}
class CI_Form_validation extends _ {}
class CI_Table extends _ {}
class MY_Model extends _ {}
?>
[/php]

[caption id="attachment_59" align="aligncenter" width="1366"]autocomplete for libraries Aptana Content Assist now showing available methods[/caption]

Comments

Popular posts from this blog

How to split large mp3 files using mp3splt

If you have a  lengthy  or large MP3 file and you want to  split  it into files of smaller size or duration, You can easily do this using mp3splt. Mp3splt   is an utility to split mp3 and ogg vorbis digital audio files without the need of decoding. It can be used to split a file into no of tracks of fixed duration and size or specified  split points. It supports variable bit rate mp3 files, silent detection, splitting with local .XMCD, .CDDB or .CUE file splitpoints or from external servers like   tracktype.org . It copies the original files first and then generates new, smaller files during the process of splitting without altering the original file. It does not do any encoding or decoding so the splitting is very fast and lossless. Steps to follow Navigate to directory where you have downloaded mp3splt { if using portable version } . Run and execute mp3slpt using the command   mp3splt  . Specify the options according to which you wanna split. The basic syntax is   mp3splt [file path]

Open .jps files on a non-3D screen

If you have a Nvidia graphics card in your PC, and if it supports Nvidia 3D Vision, you’ll have some .jps images in your Pictures folder. If you opened them on a non 3d screen you’ll encounter a error as shown below. .jps is extension for JPEG Stereoscopic images. It usually contains one image of double width, representing two images of identical size in cross-eyed side-by-side arrangement. To open .jps files you can simply change the extension to .jpg and open them in your regular Image Viewer like Windows Photo Viewer. You can also drag and drop them in other photo editing tools like IrfanView or XnView without changing the extension. The image you will see, will essentially be like below on a non-3D screen.