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.
我有一个这样的邮寄路线:
Route::post('/product/dashboard', function() { $from = Input::get('from'); $to = Input::get('to'); });
现在我想将它们传递给控制器。
我通常这样称呼控制器:
Route::get('/', 'HomeController@showWelcome');
我将如何继续使用变量?
为什么不从控制器内部访问输入变量?
Route::post('product/dashboard', 'HomeController@showDashboard');
在控制器中......
function showDashboard() { $from = Input::get('from'); $to = Input::get('to'); // do more stuff }