Part of the EllisLab Network
   
3 of 3
3
codeignitier and eclipse
Posted: 29 September 2008 04:31 AM   [ Ignore ]   [ # 31 ]  
Grad Student
Rank
Total Posts:  33
Joined  02-08-2008

Hey you’re welcome.
Maybe this should be put on a wiki or stickied?
I searched a long time before I came across this little baby and I see the same question week after week.
I use it in all my projects now. You could take it out for production but it’s not that big an issue for me.

 Signature 
Profile
 
 
Posted: 29 September 2008 08:05 AM   [ Ignore ]   [ # 32 ]  
Grad Student
Rank
Total Posts:  67
Joined  07-10-2008

I’m also using eclipse (well actually ZSE) and the method you described is very interesting indeed.
But it works only for controllers. I assume if you create a custom Model class and you copy the variables will also work for models.

But this duplicates the code and if you add another model you have to update both files and things will tend to get messy.

I’m wondering if it would be possible to create a separate file, something like “code_completion_helper” where we can define all the phpdoc comments and variables, and then include this file at the beggining of each controller/model/view or base class if exists?

I’ve tried something like that, but without any success.

Got any thoughts?

Profile
 
 
Posted: 29 September 2008 10:22 AM   [ Ignore ]   [ # 33 ]  
Grad Student
Rank
Total Posts:  33
Joined  02-08-2008

Oops,

I forgot to mention, your controllers should extend MY_Conroller like this:

class Admin extends MY_Controller {

    
function Admin()
    
{
        parent
::MY_Controller();    
    

I’ll update the original post.

 Signature 
Profile
 
 
Posted: 29 September 2008 04:06 PM   [ Ignore ]   [ # 34 ]  
Summer Student
Total Posts:  23
Joined  11-17-2007

outrage, I believe this tip is very relevant.
It should be put on wiki and stickied.

Bogdan Tanase, thinking in a very quirky way: We could create a library instead a helper.
In this library we put all the things you’re already said and the classes like MY_Controller… but i really don’t now it will works… could you test something like?

But, like outrage said: “You could take it out for production but it’s not that big an issue for me.”

Profile
 
 
Posted: 09 December 2008 07:25 AM   [ Ignore ]   [ # 35 ]  
Summer Student
Total Posts:  28
Joined  05-03-2007
outrage - 29 September 2008 02:22 PM

Oops,

I forgot to mention, your controllers should extend MY_Conroller like this:

class Admin extends MY_Controller {

    
function Admin()
    
{
        parent
::MY_Controller();    
    

I’ll update the original post.

Thanks Outrage, very good post! Works well in my version of Eclipse PDT

Profile
 
 
Posted: 13 April 2009 03:43 PM   [ Ignore ]   [ # 36 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  535
Joined  03-13-2008

anyone know how to get the method outrage mentioned working in Aptana?

 Signature 

:wq

Profile
 
 
Posted: 16 October 2009 04:38 AM   [ Ignore ]   [ # 37 ]  
Summer Student
Total Posts:  5
Joined  10-16-2009

Outrage… you’ve eased a massive headache.

Thankyou, thankyou, thankyou.

grin

Profile
 
 
Posted: 16 October 2009 05:25 AM   [ Ignore ]   [ # 38 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  674
Joined  07-16-2008

Theres been a long time since I’ve used eclipse. I use Netbeans as its lighter than eclipse. NB doesnt have CI autocompletion by default but fortunately there is a way to get it working:
http://www.mybelovedphp.com/2009/01/27/netbeans-revisited-code-completion-for-code-igniter-ii/

I was wondering if this applies also to Eclipse?

Profile
 
 
Posted: 19 October 2009 04:58 PM   [ Ignore ]   [ # 39 ]  
Grad Student
Avatar
Rank
Total Posts:  69
Joined  10-14-2008
cahva - 16 October 2009 09:25 AM

Theres been a long time since I’ve used eclipse. I use Netbeans as its lighter than eclipse. NB doesnt have CI autocompletion by default but fortunately there is a way to get it working:
http://www.mybelovedphp.com/2009/01/27/netbeans-revisited-code-completion-for-code-igniter-ii/

I was wondering if this applies also to Eclipse?

Works (on netbeans… but on eclipse too, i think)!!
Many thanks smile

 Signature 

CodeIgniterPhp5 Plugin (Autoloader, Modularity, Fast Coding) | Notepad++ Color Theme for NetBeans

Profile
 
 
Posted: 05 March 2010 10:50 AM   [ Ignore ]   [ # 40 ]  
Summer Student
Total Posts:  1
Joined  02-09-2010

I have best way to add autocomplete in eclipse

class CI_Base {
/**
/* add all vars in this class like..load,uri etc
  var $load
  var $uri
 
  function CI_Base()

}

  /**————————————————————————————————————————-
  /* in your class libray add some variables and function
/* as this

class CI_URI {
 
  //add this var to you library class
  private static $instance;

  function CI_URI()
  {
    //add this line into constuctor method
    self::$instance =& $this;
  }
 
  //add this function

  public static function &get;_uri_instance()
  {
    return self::$instance;
  }
 
}//end class

//add one more method out of this class

  function &get;_uri_instance()
  {
    return CI_URI::get_uri_instance();
  }
// end of URI.php file

//————————————————————————————————————-
// add this class into library folder
class Autoassist extends CI_Base
{
 
 
  function __construct()
      {
      $this->uri =& get_uri_instance();
      }//end funciton
}//end class

Profile
 
 
Posted: 06 March 2010 11:05 AM   [ Ignore ]   [ # 41 ]  
Summer Student
Total Posts:  1
Joined  03-06-2010
somnath - 05 March 2010 03:50 PM

I have best way to add autocomplete in eclipse

class CI_Base {
/**
/* add all vars in this class like..load,uri etc
  var $load
  var $uri
 
  function CI_Base()

}

  /**————————————————————————————————————————-
  /* in your class libray add some variables and function
/* as this

class CI_URI {
 
  //add this var to you library class
  private static $instance;

  function CI_URI()
  {
    //add this line into constuctor method
    self::$instance =& $this;
  }
 
  //add this function

  public static function &get;_uri_instance()
  {
    return self::$instance;
  }
 
}//end class

//add one more method out of this class

  function &get;_uri_instance()
  {
    return CI_URI::get_uri_instance();
  }
// end of URI.php file

//————————————————————————————————————-
// add this class into library folder
class Autoassist extends CI_Base
{
 
 
  function __construct()
      {
      $this->uri =& get_uri_instance();
      }//end funciton
}//end class

Thank for your code!

Profile
 
 
Posted: 06 March 2010 04:02 PM   [ Ignore ]   [ # 42 ]  
Grad Student
Avatar
Rank
Total Posts:  44
Joined  11-22-2009

Couldn’t read the whole things, but I found a solution for this problem with Eclipse.
I posted it here: http://codeigniter.com/forums/viewthread/144722/

Enjoy!

 Signature 

Shay Ben Moshe - Web Developer.
Exalted Web (my portfolio - Hebrew)
Zend Certified Engineer

Profile
 
 
Posted: 02 February 2011 05:25 AM   [ Ignore ]   [ # 43 ]  
Summer Student
Total Posts:  4
Joined  08-22-2010

Hi! This is a my solution for enable code complition in Eclipse. Put “foreclipse.php” in your document root. Enjoy it! http://asakasinsky.blogspot.com/2011/02/codeigniter-eclipse-pdt-aptana-studio.html
P.S if you use CI ver 1.7, then change “class CI_Controller {” to “class Controller {”

Profile
 
 
   
3 of 3
3