routes - can i do this?

#1
[eluser]MMCCQQ[/eluser]
hi!

i build a webapp . so i want this

i got Profile URL:
CASE 1
http://domain.com/mmccqq

and i got Other URL with Numbers:
CASE 2
http://domain.com/7879874

so i wanna do this too:

http://domain.com/mmccqq/add_comment
http://domain.com/7879874/photos

i got this:
CASE 1:
$route['(:any)'] = "main/index/$1";
CASE 2:
$route['(:num)'] = "v/index/$1";

its right?

#2
[eluser]Wuushu[/eluser]
How will it know if it's a variable/username or controller name you are requesting? Or perhaps you have no other controllers other than main and v?

#3
[eluser]frenzal[/eluser]
you can do it, i don't think the index shouldbe in your route though unless you don't want to use other functions in your controller but it looks like you do

#4
[eluser]MMCCQQ[/eluser]
so. if i got other , i can't do it

?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.