0
내가 생각한 것보다 더 간단한 방법이 있어야한다는 것을 알고 있으므로 여기서 물어볼 것입니다.블레이드에서 루트로 변수를 전달하고 그곳에서 다른 경로로 패스
나는
public function create() {
return View::make('exam.index');
}
ExamController을 (당신이 시작 테스트를 클릭하면) 여기에서
$exam->id
을 통과
@foreach($category->exams as $exam)
<tr>
<td>{{$exam->id}}</td>
<td>{{$exam->title}}</td>
<td>od {{$exam->start_date}} do {{$exam->end_date}}</td>
<td class="center"><span class="badge">{{$exam->number_of_points}}</span></td>
<td class="center"><a href="#"><i class="fa fa-arrow-circle-right"></i> Start test</a></td>
</tr>
@endforeach()
이이 경로를 사용하고 그 변수
Route::get('exam','[email protected]'); // this is where i dont know how to set route to pass to another one
을 통과해야합니다
그리고 finnaly 사용자가 submit을 클릭하면, 그 $ exam_id를 ajax에 보냄으로써 난 그냥 내가 그걸 통과 할 방법을 알고하지 않는 양식에 대신 1 $exam_id
처럼 무작위 시험 ID 번호를 넣을 때 t 시험
{{ Form::open(['data-remote', 'method' => 'GET', 'route' => ['exam_data',$exam_id]]) }}
<div class="exam-name">
</div>
<div class="form-group exam">
Click Start to start the test!
</div>
<div class="form-group">
{{ Form::submit('Start', ['class' => 'btn btn-default','id'=>'btn-next-question', 'data-confirm']) }}
</div>
{{Form::close()}}
국도 버튼을
Route::get('exam/{id}',['as' => 'exam_data', 'uses' => '[email protected]']);
모든 제출을 위해 잘 작동합니다. 어떤 도움을 주셔서 감사합니다.
세션 내에 정보를 저장하십시오. 그런 다음 모든 요청에 대해 사용할 수 있습니다. –
좋은 아이디어, 시도해 보겠습니다. – MePo