Reputation: 6264
I am new to Laravel 4. I am trying here is that whenever I click in a link I will go to route, there I will print something. Now one part of the link has to be variable. In the route I want to print the variable.
The code for the link is given below:
URL::to("category/{$category}
This code in routes.php is
Route::get('category/{$c}', function($c){
return $c;
});
It is showing me:
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException.
Upvotes: 0
Views: 428
Reputation: 146239
Try this ({c}
instead of {$c}
)
Route::get('category/{c}', function($c){
echo $c;
});
Upvotes: 2