URI class fails |
[eluser]ivo_shandor[/eluser]
I'm a bit of a Codeigniter noob so forgive the question if it's a bit dumb... I'm trying to use the URI class but I get nothing from functions such as base_url() or $this->uri->uri_string(). However "echo $_SERVER[@REQUEST_URI];" does work. I'm using Wampserver on WinXP. Does anyone have any ideas?
[eluser]BrianDHall[/eluser]
If its an error then you haven't loaded the helper: http://ellislab.com/codeigniter/user-gui...elper.html Quote:Loading this Helper If that isn't the problem you'll need to be a bit more specific as to how the functions don't work. If their output is wrong check your config.php settings.
[eluser]ivo_shandor[/eluser]
Thanks Brian. I've definitely loaded the helper so that's not the problem. Since my previous post I've tried changing the URI_PROTOCOL settings in the config.php file and the best outcome has been with the PATH_INFO setting. Now base_url() and a couple of other functions have begun working but I have problems with uri_string() and others. To illustrate my problem, I have created a view with the following commands: Code: <?php echo(current_url()); ?> // produces 'http://localhost/ci/index.php' All this is given in the view with "http://localhost/ci/index.php/agent/profile/1" in the browser address bar. As you can see uri->segment(n) doesn't seem to be working and the current_url seems to be wrong. I hope this is clear enough. I've spent several hours looking at this and my brain feels fried...
[eluser]ivo_shandor[/eluser]
Managed to fix it with one or more of the following steps. First, I switched to xampp, then I went about trying different URI_PROTOCOLS and I also deleted a call to load the URI class that was lying around in one of my other controllers - it's loaded by default anyway and I believe that was causing the problem. Thanks for you help though! |
Welcome Guest, Not a member yet? Register Sign In |