Welcome Guest, Not a member yet? Register   Sign In
SVN + CodeIgniter
#3

[eluser]cahva[/eluser]
How have you structured your code? I've seen a lot of beginners doing this:

Somecontroller
Code:
function show()
{
    $id = $this->uri->segment(4,1);
    if (!$id)
    {
        return FALSE;
    }

    // Do something
}

Assuming that id would have come after the /show/ this would been better done like this:
Code:
function show($id = FALSE)
{
    if (!$id)
    {
        return FALSE;
    }
    
    // Do something
}

That way it doesnt matter what url you are on..

Other thing that you should consider is giving your projects a proper urls in your local dev machine. For example I always add vhost to my webserver and add a domain pointing to my localhost. Something like this:

- production server: www.mysite.com
- local server; local.mysite.com

To get the "local.mysite.com" to point to my own devserver, in windows environment I add this line to C:\WINDOWS\system32\drivers\etc\hosts file:
Quote:127.0.0.1 local.mysite.com

After that the directory structure will be the same on both:
Quote:http://www.mysite.com/class/method
http://local.mysite.com/class/method


Messages In This Thread
SVN + CodeIgniter - by El Forum - 09-01-2010, 07:46 AM
SVN + CodeIgniter - by El Forum - 09-01-2010, 07:51 AM
SVN + CodeIgniter - by El Forum - 09-01-2010, 08:22 AM
SVN + CodeIgniter - by El Forum - 09-01-2010, 11:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB