Welcome Guest, Not a member yet? Register   Sign In
uri_segments problem
#1

[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
#2

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

Code:
$_SERVER['REQUEST_URI'];

easy..
#3

[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).
#4

[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.
#5

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




Theme © iAndrew 2016 - Forum software by © MyBB