CodeIgniter Forums
Route Attributes? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Route Attributes? (/showthread.php?tid=42689)



Route Attributes? - El Forum - 06-15-2011

[eluser]Y0shi[/eluser]
Hey there,

so I'm playing around with routes at the moment and I'm trying to do something like pagination with routes or non-ajax tabs with routes. Is it possible to do something like:

GENERAL
article/showarticle/id/page

ROUTE
codeigniter-is-great -> goes to article/showarticle/1/1

WHEN I SWITCH TO PAGE TO
The URI will turn to article/showarticle/1/1 and will not stay as codeigniter-is-great or something like that

Is there a way to pass attributes for things like pagination or tabs into routes? If yes, how?

Best regards


Route Attributes? - El Forum - 06-17-2011

[eluser]Y0shi[/eluser]
Has anyone a clou how to do this?


Route Attributes? - El Forum - 06-17-2011

[eluser]danmontgomery[/eluser]
http://ellislab.com/codeigniter/user-guide/general/routing.html

Code:
$route['codeigniter-is-great'] = 'article/showarticle/1/1';
$route['codeigniter-is-great/(:num)'] = 'article/showarticle/1/$1';