获取Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException

时间:2014-08-08 17:18:15

标签: php symfony laravel hyperlink laravel-routing

我知道这个错误,这是一个路由错误,但我复制并粘贴了六次路由,三次工作,三次不做。

Route::get('/reps-distributors', 'PagesController@reps');
Route::get('/reps-distributors/usa', 'PagesController@repsUSA');
Route::get('/reps-distributors/netherlands', 'PagesController@repsNetherlands');
Route::get('/reps-distributors/middleeast', 'PagesController@repsMiddleEast');
Route::get('/reps-distributors/mexico', 'PagesController@repsMexico');
Route::get('/reps-distributors/fareast', 'PagesController@repsFarEast');
Route::get('/reps-distributors/europe', 'PagesController@repsEurope');

引起我问题的树是墨西哥,远东和欧洲。

以下是控制器页面

 /**
 * Show the reps-distributors page
 *
 * @return Response
 */
public function reps()
{
    return View::make('reps');

}

/**
 * Show the reps-distributors page
 *
 * @return Response
 */
public function repsUSA()
{
    return View::make('reps/usa');

}

/**
 * Show the reps-distributors page
 *
 * @return Response
 */
public function repsNetherlands()
{
    return View::make('reps/netherlands');

}

/**
 * Show the reps-distributors page
 *
 * @return Response
 */
public function repsMiddleEast()
{
    return View::make('reps/middleeast');

}

/**
 * Show the reps-distributors page
 *
 * @return Response
 */
public function repsMexico()
{
    return View::make('reps/mexico');

}

/**
 * Show the reps-distributors page
 *
 * @return Response
 */
public function repsFarEast()
{
    return View::make('reps/fareast');

}

/**
 * Show the reps-distributors page
 *
 * @return Response
 */
public function repsEurope()
{
    return View::make('reps/europe');

}

我只是不明白,因为他们看起来都一样,他们也应该这样做。

以下是其中一个损坏的视图页面:

<h1>Reps &amp; Distributors</h1>

<h3>Mexico</h3>

<h4>Distributors</h4>

这是链接:

<p><a href="/reps-distibutors/mexico">Mexico</a></p>

1 个答案:

答案 0 :(得分:0)

您的链接中存在拼写错误。而不是

<p><a href="/reps-distibutors/mexico">Mexico</a></p>

你需要写

<p><a href="/reps-distributors/mexico">Mexico</a></p>
相关问题