CodeIgniter Forums
Eclipse PDT Plugin for CodeIgniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Eclipse PDT Plugin for CodeIgniter (/showthread.php?tid=70275)



Eclipse PDT Plugin for CodeIgniter - carlospauluk - 03-17-2018

Hi,

I´m a long time java developer, used to Eclipse tools. Now I´m starting development with PHP and CodeIgniter. I'm trying to use Eclipse PDT, but as far as I looked, there's no support for work with CodeIgniter (code completion).

Does anyone knows how to get this working?

Thanks


RE: Eclipse PDT Plugin for CodeIgniter - donpwinston - 03-17-2018

(03-17-2018, 08:31 AM)carlospauluk Wrote: Hi,

I´m a long time java developer, used to Eclipse tools. Now I´m starting development with PHP and CodeIgniter. I'm trying to use Eclipse PDT, but as far as I looked, there's no support for work with CodeIgniter (code completion).

Does anyone knows how to get this working?

Thanks

I use Eclipse and PDT with CodeIgniter4. I think CI3 should work also. You got to add the system folder to the PHP include path.


RE: Eclipse PDT Plugin for CodeIgniter - danielcr_2018 - 03-20-2018

Quote:You got to add the system folder to the PHP include path.
How do you do that?


RE: Eclipse PDT Plugin for CodeIgniter - carlospauluk - 03-20-2018

I think that the main problem is that CI 3 doesn´t support full PHP namespace.

I never saw how it is on CI 4. Hope that they write in this way.


RE: Eclipse PDT Plugin for CodeIgniter - donpwinston - 03-20-2018

I use Eclipse Oxygen. Right click (Ctrl click) to get the Properties menu. Select PHP > Source Paths > Include Path. Then use the "Add External Source Folder" button to add the CI system directory.


RE: Eclipse PDT Plugin for CodeIgniter - danielcr_2018 - 03-22-2018

Thanks donpwinston

It seems that it doesn't work on CI 3. After adding system folder I couldn't get code completions. Screenshot attached.


RE: Eclipse PDT Plugin for CodeIgniter - sneakyimp - 03-22-2018

It's my understanding (and I could be wrong) that the way CI is structured doesn't lend itself to code completion. For example, form_validation is not declared as a class property but is rather dynamically attached to the controller. The lack of autocomplete functionality in CI is due to a combination of dynamically attached/loaded properties and the way that Eclipse relies on class declarations and/or javadoc comments to generate your autocomplete options.

I have achieved some autocomplete happiness by extending the CI_Controller class with my own and declaring my own custom controller properties in it.