Welcome Guest, Not a member yet? Register   Sign In
Eclipse PDT
#1

[eluser]sirfak[/eluser]
can anyone tell me step by step how can i use CI with Eclipse PDT?
Thanks in advance
#2

[eluser]Stefano G[/eluser]
Hello, I am using Eclipse PDT since a while now and the setup is pretty straightforward; you can find more info in this topic:

CI plugin for eclipse

Have fun! Smile
#3

[eluser]Dam1an[/eluser]
@Stefano, you said CI plugin, and I got my hopes up Sad
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

[eluser]sirfak[/eluser]
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

[eluser]Dam1an[/eluser]
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

[eluser]sirfak[/eluser]
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

[eluser]Dam1an[/eluser]
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

[eluser]sirfak[/eluser]
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

[eluser]Dam1an[/eluser]
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

[eluser]sirfak[/eluser]
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




Theme © iAndrew 2016 - Forum software by © MyBB