Welcome Guest, Not a member yet? Register   Sign In
Codeigniter and eclipse autocomplete
#1

[eluser]web-johnny[/eluser]
In Codeigniter till now we write for example $this->session-> … and then we go to the codeigiter website just to see what was the name of the function . I created a Controller and I named it fakeController that works only for the autocomplete of eclipse and other of course editors. Write faster code and don't search everytime where the function of a library is :-) .

For more click to my Post here.

Below is my code

Code:
<?php
class CI_Controller{
    /**
     *
     * @var CI_DB_active_record
     */
    public $db;
    
    /**
     *
     * @var CI_Loader
     */
    public $load;
    
    /**
     *
     * @var CI_Output
     */
    public $output;    
    
    /**
     *
     * @var CI_Email
     */
    public $email;
    
    /**
     *
     * @var CI_Session
     */
    public $session;    
    
    /**
     *
     * @var CI_Config
     */
    public $config;    
    
    /**
     *
     * @var CI_Benchmark
     */
    public $benchmark;    
    
    /**
     *
     * @var CI_Calendar
     */
    public $calendar;
    
    /**
     *
     * @var CI_Cart
     */
    public $cart;
    
    /**
     *
     * @var CI_Encrypt
     */
    public $encrypt;
    
    /**
     *
     * @var CI_Upload
     */
    public $upload;
    
    /**
     *
     * @var CI_Form_validation
     */
    public $form_validation;
    
    /**
     *
     * @var CI_Form_validation
     */
    public $form_validation;
    
    /**
     *
     * @var CI_FTP
     */
    public $ftp;
        
    /**
     *
     * @var CI_Table
     */
    public $table;
        
    /**
     *
     * @var CI_Image_lib
     */
    public $image_lib;
        
    /**
     *
     * @var CI_Image_lib
     */
    public $image_lib;    
    
    /**
     *
     * @var CI_Input
     */
    public $input;    
    
    /**
     *
     * @var CI_Language
     */
    public $lang;    
    
    /**
     *
     * @var CI_Language
     */
    public $lang;    
    
    /**
     *
     * @var CI_Pagination
     */
    public $pagination;
        
    /**
     *
     * @var CI_Trackback
     */
    public $trackback;    
    
    /**
     *
     * @var CI_Parser
     */
    public $parser;    
    
    /**
     *
     * @var CI_Typography
     */
    public $typography;    
    
    /**
     *
     * @var CI_Unit_test
     */
    public $unit;
        
    /**
     *
     * @var CI_URI
     */
    public $uri;
        
    /**
     *
     * @var CI_User_agent
     */
    public $agent;    
    
    /**
     *
     * @var CI_Xmlrpcs
     */
    public $xmlrpcs;    
    
    /**
     *
     * @var CI_Xmlrpc
     */
    public $xmlrpc;    
    
    /**
     *
     * @var CI_Zip
     */
    public $zip;
    
}
#2

[eluser]CroNiX[/eluser]
I've been using it for so long without it I forgot how handy this could be. Thank you Smile
#3

[eluser]web-johnny[/eluser]
if you're using CI 2.0 just rename Controller to CI_Controller and autocomplete will work
#4

[eluser]web-johnny[/eluser]
If you like you can download the "fake" Controller for CI 2.0.0 from the url http://www.web-and-development.com/downl...CI_2.0.zip
#5

[eluser]CroNiX[/eluser]
Just putting this here in case others have the same problem. If you still can't get autocomplete to work after the above solution, try this fix found on the Zend forums. It worked for me using ZS7 and also ZS8, both on windows and osx.

http://forums.zend.com/viewtopic.php?f=5...=20#p19107
#6

[eluser]web-johnny[/eluser]
for Codeigniter 2.0 below is the code for the autocomplete ( Its works fine with Netbeans also )
Code:
class CI_Controller {
    /**
     *
     * @var CI_DB_active_record
     */
    public $db;
    
    /**
     *
     * @var CI_Loader
     */
    public $load;
    
    /**
     *
     * @var CI_Output
     */
    public $output;    
    
    /**
     *
     * @var CI_Email
     */
    public $email;
    
    /**
     *
     * @var CI_Session
     */
    public $session;    
    
    /**
     *
     * @var CI_Config
     */
    public $config;    
    
    /**
     *
     * @var CI_Benchmark
     */
    public $benchmark;    
    
    /**
     *
     * @var CI_Calendar
     */
    public $calendar;
    
    /**
     *
     * @var CI_Cart
     */
    public $cart;
    
    /**
     *
     * @var CI_Encrypt
     */
    public $encrypt;
    
    /**
     *
     * @var CI_Upload
     */
    public $upload;
    
    /**
     *
     * @var CI_Form_validation
     */
    public $form_validation;
    
    /**
     *
     * @var CI_Form_validation
     */
    public $form_validation;
    
    /**
     *
     * @var CI_FTP
     */
    public $ftp;
        
    /**
     *
     * @var CI_Table
     */
    public $table;
        
    /**
     *
     * @var CI_Image_lib
     */
    public $image_lib;
        
    /**
     *
     * @var CI_Image_lib
     */
    public $image_lib;    
    
    /**
     *
     * @var CI_Input
     */
    public $input;    
    
    /**
     *
     * @var CI_Language
     */
    public $lang;    
    
    /**
     *
     * @var CI_Language
     */
    public $lang;    
    
    /**
     *
     * @var CI_Pagination
     */
    public $pagination;
        
    /**
     *
     * @var CI_Trackback
     */
    public $trackback;    
    
    /**
     *
     * @var CI_Parser
     */
    public $parser;    
    
    /**
     *
     * @var CI_Typography
     */
    public $typography;    
    
    /**
     *
     * @var CI_Unit_test
     */
    public $unit;
        
    /**
     *
     * @var CI_URI
     */
    public $uri;
        
    /**
     *
     * @var CI_User_agent
     */
    public $agent;    
    
    /**
     *
     * @var CI_Xmlrpcs
     */
    public $xmlrpcs;    
    
    /**
     *
     * @var CI_Xmlrpc
     */
    public $xmlrpc;    
    
    /**
     *
     * @var CI_Zip
     */
    public $zip;
    
}
#7

[eluser]Unknown[/eluser]
It worked well for me.
Thank you very much.




Theme © iAndrew 2016 - Forum software by © MyBB