Welcome Guest, Not a member yet? Register   Sign In
Why be throwing around $this->config->item('base_url') ? Why not stick with $_SERVER('HTTP_HOST')?
#4

[eluser]Phil Sturgeon[/eluser]
Some set the base_url with SERVER_NAME/HTTP_HOST and a bunch of other parts. I find that your config should be the only place you define what the URL is (manually or dynamically) then you can refer to that one single value the throughout your app.

If you are consistent with whichever you use and you know that right now you will NEVER want to use your app on a sub-domain or develop on a local machine that might want to use a port other than 80, then go ahead, but it will f**k you if you try to change later on.


Messages In This Thread
Why be throwing around $this->config->item('base_url') ? Why not stick with $_SERVER('HTTP_HOST')? - by El Forum - 12-21-2009, 10:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB