Created
April 14, 2014 21:45
-
-
Save mattwells/10684911 to your computer and use it in GitHub Desktop.
Nested Routes in Laravel 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::group(['prefix' => 'forum/{fId}'], function() | |
{ | |
Route::resource('topic/{tId}', 'TopicController'); | |
}); | |
Route::resource('forum', 'ForumController'); | |
class TopicController extends BaseController | |
{ | |
public function index($fId, $tId) { | |
return "Topic ID {$tId} in Forum ID {$fId}"; | |
} | |
// --- other methods | |
} | |
class ForumController extends BaseController | |
{ | |
public function index($fId) | |
{ | |
return "Forum ID {$fId}"; | |
} | |
// --- other methods | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment