0
Laravel 4를 처음 사용하는데 다음 오류가 나타납니다. 경로 "cat_edit"에 대한 URL을 생성하기 위해 일부 필수 매개 변수가 누락되었습니다 ("id").Laravel 4가 URL 오류를 생성합니다.
public function editAction($id){
$category = Category::find($id);
$categories = Category::all();
return View::make('categories.edit', array(
'category' => $category ,
'categories' => $categories,
));
}
그리고 마지막으로 내보기 : 여기
Route::get('/category/{id}/edit', array(
'as' => 'cat_edit',
'uses' => '[email protected]'
))->where('id', '[0-9]+');
내 컨트롤러 : 여기
내 경로의 내가 시간을 찾고 있었어요
@extends('layouts.main')
@section('title')
Edit category
@stop
@section('content')
<h1>Add a Category</h1>
{{ Form::open(array('action' => '[email protected]')) }}
{{ Form::form_lab('text', 'name', 'Name') }}
{{ Form::form_lab('textarea', 'description', 'Description') }}
{{ Form::form_select('parent', 'Parent', $categories) }}
<div class="form-actions">
{{ Form::form_button('Validate') }}
</div>
{{ Form::close() }}
@stop
하지만 그럴 수 없어 내가 틀린 곳을 봐. 모두, 내 다른 경로가 잘 작동하고 있습니다.
감사합니다.
이 괜찮 았는데, 감사합니다! –