Laravel 4 dynamic route with multiple segments
I would like to create a dynamic route that allows multiple segments.
example.com/segment1
example.com/segment1/segment2/
example.com/segment1/segment2/segment3
Using this:
Route::get('{slug}', 'PagesController@index');
Gives me my first dynamic segment and of course I could do this:
Route::get('{slug1}/{slug2}', 'PagesController@index');
and so on but I'm sure there's a better way to do this.
Any help would be great.
Thanks,
-M
No comments:
Post a Comment