laravel 프로젝트에서 컨트롤러 액션에 문제가 있습니다. 모든 것이 정상적으로 보이므로 왜 그런지 알 수 없습니다. Heres는액션이 정의되지 않았습니다. laravel/php 컨트롤러
오류 부분에 관한 내 경로 : Heres는
Route::get('/reminds','[email protected]');
Route::get('/reminds','[email protected]');
만들기와 RemindController.php 파일에 정의 된 인덱스 방법 : create.blade.php에서
public function index()
{
$reminds = Remind::all();
return View::make('remind.index', compact('reminds'));
}
public function create()
{
try {
$listyears = RemindController::generate_list(date('Y')-100, 101);
$listmonths = RemindController::generate_list(1, 12);
$listdays = RemindController::generate_list(1, 31);
return View::make('remind.create', compact('listyears', 'listmonths', 'listdays'));
} catch (Exception $e){
App:abort(404);
}
}
(의 생각 나게하다) 내가 문제있는 색인이라고 부르는 이것을 가지고있다 :
<div class="panel-heading">
<h2>create reminder</h2>
</div>
<div class="panel-body">
{!! Form::open(['action'=> '[email protected]', 'class' => 'form']) !!}
문제는 각각 알림 작성 양식을 호출하는 페이지에 액세스하려고 할 때 오류가 발생합니다.
ErrorException (E_ERROR)
Action App\Http\Controllers\[email protected] not defined. (View: C:\Users\myusername\Desktop\project\prototype\resources\views\remind\create.blade.php)
그러나 명확하게 정의했습니다. 나는 이해하지 못한다.
감사합니다! 잘 설명했다. laravel 5 이후 새로운 방법 이니? –
실제로 없습니다. 전역 변수에 대한 정적 호출은 더 이상 권장되지 않습니다. Route : :(), Session ::, Cache :: etc 등을 호출하는 대신 route() ->, session() ->, cache() -> etc를 사용할 수 있습니다. 이게 더 명확 해. –