CodeIgniter Forums
uri_segments problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: uri_segments problem (/showthread.php?tid=13795)



uri_segments problem - El Forum - 12-05-2008

[eluser]Unknown[/eluser]
hi,

I think that is a bug.
look my source controllers/first.php
Code:
function index()
{
$this->load->helper('url');
$data['switch'] = uri_segments();
$this->load->view('first',$data);    
}

then I get error with:
Fatal error: Call to undefined function uri_segments() in C:\wamp\www\system\application\controllers\first.php on line 20


uri_segments problem - El Forum - 12-05-2008

[eluser]Unknown[/eluser]
is it official bug?
http://codeigniter.com/bug_tracker/bug/6025/

Code:
$_SERVER['REQUEST_URI'];

easy..


uri_segments problem - El Forum - 12-05-2008

[eluser]Michael Wales[/eluser]
You are correct, in that it is a bug with the User Guide. The correct function is uri_string() - this function was added in 1.7.0, just appears they got the changelog and the User Guide wrong.

To the devs: I prefer uri_string() as it matches the library, since all the helper functions do is call the corresponding library method. Adds a logical path to follow without having to dig through the code.


So, use either uri_string() after you have loaded the helper or use $this->uri->uri_string();


Edit: Also moved this to the correct forum (Bug Reports).


uri_segments problem - El Forum - 02-05-2009

[eluser]CrossMotion[/eluser]
Ring Ring.... Why the hell is this still not updated in the user guide? I just spend a half hour trying to get uri_segments() working.


uri_segments problem - El Forum - 02-06-2009

[eluser]Michael Wales[/eluser]
Ring Ring... Because the User Guide is updated on version releases. New version not released, User Guide not updated.