php - laravel can't print the correct parameter -
php - laravel can't print the correct parameter -
i have function
public function show($id) { echo $id;exit; $restaurant = restaurant::find($id); homecoming view::make('restaurants.profile')->with('restaurant', $restaurant); }
i phone call this:
http://localhost:8082/profjectname/public/restaurants/show/20
i got error:
symfony \ component \ httpkernel \ exception \ notfoundhttpexception
when phone call way:
http://localhost:8082/parkingproject/public/restaurants/show?id=3
it prints show
instead of 3
when phone call way:
http://localhost:8082/parkingproject/public/restaurants/testestestes?id=3
it prints testestestes
instead of 3
i have :
route::resource('restaurants', 'restaurantscontroller');
the routes works other functions in controller, don't thing route has error.
could help me please
if you're using resource controller, there's no need set show
in url, e.g.
http://localhost:8082/profjectname/public/restaurants/20
see resource controllers
so resource controller restaurants
:
verb path action route name /restaurants index resource.index /restaurants/create create resource.create post /restaurants store resource.store /restaurants/{restaurant_id} show resource.show
php laravel laravel-4
Comments
Post a Comment