Welcome Guest, Not a member yet? Register   Sign In
Passing URI segments to my functions
#1

[eluser]jimps[/eluser]
Hi!
I have a problem with my URI segments, i want them to my functions but it does not work.
http://ellislab.com/codeigniter/user-gui...passinguri

This is my .htaccess:
Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

And this is my routings:
Code:
$route['([a-zA-Z0-9_-]+)'] = "profile/view/$1";

So it's the $1 value i want to be passed to the view method in the profile controller. But it's always undefined.

How can i solve this?
Thanks.


Regards,
Jimps
#2

[eluser]jimps[/eluser]
*BUMP*

Anyone?
#3

[eluser]keld[/eluser]
You don't need to use $route to do that, you can just do it from your controller like:
[code]
$getvar=$this->uri->segment(3);
$this->load->view('mypage', $getvar);
[code]

And now you can access it from your view.




Theme © iAndrew 2016 - Forum software by © MyBB