4

I'm trying to create a route using a wildcard, with the syntax I know from L3, but I keep getting a 404.

I registered my route in routes.php:

Route::get("get_cities/(:num)","QueryController@get_cities");

The controller and the function exist and are found when I remove the wildcard. Has the syntax changed?

And while I'm at it: Is there any documentation I can refer to with similar problems, or is it yet to be written?

4

1 回答 1

5

你会想要类似的东西...

Route::get('cities/{id}', 'CityController@showProfile');

文档已经发布了一段时间了...

http://four.laravel.com/docs/routing#route-parameters
http://four.laravel.com/docs/controllers

于 2013-01-18T17:05:44.900 回答