문제

This works fine:

Route::get('blade-second', function()
{
  $slug = 'star-wars';
  $movies = array(
    'star-wars' => array('name' => 'Star Wars', 'year'
     => '1977', 'genre' => 'Sci-Fi'),
    ...
  );
  return View::make('blade.second')->with('movie', $movies[$slug]);
});

but replace it with this:

Route::get('blade-second/(:any)', function($slug)
{
  $movies = array( ... );

  return View::make('blade.second')->with('movie', $movies[$slug]);
});

and it results in a 200 NotFoundHttpException.

도움이 되었습니까?

해결책 2

try to use brackets, and no colon

'blade-second/{any}'

다른 팁

If this is Laravel 4, that syntax is no longer valid and you should use the style listed in the documentation: http://laravel.com/docs/routing.


라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top