Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要制定工作路线/和/today路线。以这种方式尝试:
/
/today
Route::get('/{home}', function() { return View::make(...); })->where('home', '$^|null||today');
它适用于/today但不适用于/. 也试过这样:|today,,today|等等&^|today..似乎没有任何效果:)感谢您的帮助:)
|today
today|
&^|today
您仍然可以通过?在结束前放置 a 来将占位符定义为可选}。
?
}
Route::get('/{home?}', function() { return View::make('home'); })->where('home', 'today');
这对我有用:
Route::get('/{home}', function($home) { return View::make('hello'); })->where('home','^(today|)');