can anyone tell me step by step how can i use CI with Eclipse PDT?
Thanks in advance
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
June 19, 2009 3:21am
Subscribe [4]#1 / Jun 19, 2009 3:21am
can anyone tell me step by step how can i use CI with Eclipse PDT?
Thanks in advance
#2 / Jun 19, 2009 4:39am
Hello, I am using Eclipse PDT since a while now and the setup is pretty straightforward; you can find more info in this topic:
Have fun! 😊
#3 / Jun 19, 2009 5:26am
@Stefano, you said CI plugin, and I got my hopes up :(
To add to what Stefano said, in order to get full auto complete working, including CI libraries (cause with your setup it just had helpers and class names) I done this
That should give you full auto complete then doing $this->db->...
#4 / Jun 19, 2009 6:44am
Thanks Everyone for reply.Let me explain you what I am doing so far.
My Eclipse workspace is in C:\PHPWRKSPC and CI folder is C:\ci171.
Now in eclipse I created a new PHP project called CodeIgniter and i imported the file system so my workspace looks like
CodeIgniter
————-system
| —-application
| —-cache etc
|
————-user_guide
Now I also have XAMPP installed in my system at C:\xmapp and root of the apache server is C:\xmapp\xampp\htdocs
Now what i need to do is that i want to develop my application here and should be able to run it here only.
Could you be able to tell me how i should proceed from here.
Please explain in details as I am a beginner in CI and WebDevelopment
lots of Thanks in advance
sirfAK
#5 / Jun 19, 2009 7:40am
You have 2 options
1) Extract CI into the web root, and use that as the project source (you can have projects outside of your workspace)
2) Symlink your project into the web root (I use this shell extension
#6 / Jun 19, 2009 8:14am
Thanks Dam1an for your suggesstion.
Could you be able to explain the option in detail if you dont mind. It would be a great help.
In the mean time i am doing this.I extract CI into the webroot so my document structure looks like
C:\xmapp\xampp\htdocs\CodeIgniter (Please note that C:\xmapp\xampp\htdocs\ is my web root)
Now I will change httpd.conf file (setting document root)to point to
C:\xmapp\xampp\htdocs\CodeIgniter\system\application\views\index.php
And in eclipse I will import C:\xmapp\xampp\htdocs\CodeIgniter this file system.
Is it OK??????????? or I am ssimply wasting time.
Thanks
sirfAK
#7 / Jun 19, 2009 8:34am
No no no no no!
Do NOT change the web root in httpd.conf, you don’t need to, and it can sometimes cause problems with XAMPP, if you need the web root else where, Sym links is the way to go (but thats a topic for another day, I’ll keep things simple for this)
Another thing to mention (doesn’t apply if you used the installable version) you’ll need to the the setup.bat or whatever it’s called as XAMPP isn’t in a top level directory (why do you have xampp/xampp?)
Now onto the fun stuff
1) Put everything back to how it was, so the web root is back to htdocs, delete all the contents of that for now (if you’ve done any work, move it somewhere else for now)
2) Extract CI into the web root, so you now have C:\xampp\xampp\htdocs\CodeIgniter_1.7.1
3) You can change the CI structure at this point if you want (eg I move the core out of the web root, move the application folder and index.php into a project folder in the root with a short, descriptive name). I’ll assume you’re leaving the default layout for the time being
4) Open up Eclipse (you can delete the old projects there as they’re no longer valid)
5) Create a new project, give it a new name and then select “Create project from existing source”. Browse to the CI folder in you’re web root and select that
6) You can finish now, as the rest of project setup is irrelevant (unless you changed the structure and need to link the application to the core, in which case I recommend creating the core project first)
7) That’s it, you should not have index.php and the config, controllers etc folders at the top level of your project, and the site is visible at http://localhost
Is that clear enough?
#8 / Jun 19, 2009 8:52am
Thanks alot Dam1an for your help.
I am able to configure my application with you help.
Thanks alot.
Now if you are not irritated with queries, then could you be able to help me with one more doubt. that is..
Now I can create my application in eclipse but to check it I have to go to mozilla and try http://localhost to see the output.
Is is posiible that I can rite click on index.php and run as PHP webpage in eclipse.
I tried to do it but I am not getting. I think I need to do some server setting
Could you be able to help me with this issue????????
Thanks alot in advance
sirfAK
#9 / Jun 19, 2009 9:00am
I know this is possible with plain PHP by setting the server base path, but don’t think it’s possible with CI (and it’s totally logical if you think about it)
If you select to view a controller, there’s no way for it to know which function you want (and it doesn’t even know that each function is a page)
If you want to view a view file, there’s no way for it to know the corresponding controller/function
I personally just have Eclipse on one screen and firefox on the other, so it’s not really an issue for me
#10 / Jun 19, 2009 9:21am
Thanks for your reply. I will also use view things in firefox.
Now I have application set up ready.
As of now if i try http://localhost it goes to index file
(ie C:\xmapp\xampp\htdocs\test\application\views\index.php since I have set my webroot as C:\xmapp\xampp\htdocs\test\application\views)
Now I want to test one simple application
I have a Blog.php controller
—————————————————————————————————————————-
<?php
class Blog extends Controller {
function index()
{
echo 'Hello World!';
}
}
?>
————————————————————————————————————————————-
and I have a index.php in application/views
————————————————————————————————————————————
<html>
<head><title></title>
</head>
<body>
TestPage
</body>
</html>
—————————————————————————————————————————————-
Now how should I proceed.
Thanks in Advance
#11 / Jun 19, 2009 9:25am
Which part of number 1 in my list did you not follow? I said put the web root back as htdocs!
Also, if you’re trying to execure index.php in views, then I think you need to reread about the CI application structure and flow, as I don’t think you have a basic understanding of this stuff yet (you’re still thinking like old fashioned style PHP)
#12 / Jun 19, 2009 9:33am
Hi I understood your details.
Suppose I have folder structure as
htdocs——-
—index.html
—CodeIgniter
now if i do http://localhost
It will display me the index.php in the folder. and will not go to CodeIgniter folder.
That is why I explicitly mentioned webroot to point to codeIgniter>>application>>views
I accept that I am a beginner in this case so please ignore some mistakes
Please suggest how to proceed with above case
Thanks in advance
sirfAK
#13 / Jun 19, 2009 10:31am
Seeing as you’ve changed everything, is the index.php that you’re refering to the default CI front controller, or a view file which you created yourself?
I really think you need to read the user guide
#14 / Jun 19, 2009 10:44am
Hi Dam1an,
Thanks for all your help.I re-organised my structure as per your previous suggestion and now I am able to create some sort of application.
It was a great help from your side. Keep the same attitude
Thanks. now i will be starting my webapplication with some basic step.
will surely catch u if get into trouble
Thanks
sirfAK
#15 / Jun 19, 2009 10:47am
You’re welcome, glad you finally got it working
Let the fun begin 😊