【发布时间】:2016-12-07 04:27:06
【问题描述】:
我在我的一个项目中使用 Laravel 框架和刀片模板引擎,其中我有一条看起来像
的路线Route::get('/problems/{problem-id}/edit', 'AdminController@editProblem');
我在 AdminController 中有 editProblem 方法,它返回一个视图
public function editProblem(Problem $problem) {
return view('admin.problem-edit', compact('problem'));
}
我在视图上有一个按钮,看起来像
<button class="btn btn-xs btn-info pull-right">Edit</button>
现在我想在单击按钮时使用$problem->id 调用此路由。我需要在路由上传递这些值。
我该怎么做?
【问题讨论】:
标签: php laravel laravel-5 routes balde