Question

I'm trying to make a link work in laravel 4, the link is:

<a href="NieuweTaak">Nieuwe taak</a>

This link will result in

laravel/ToDo/public/NieuweTaak

My routing is:

Route::get('NieuweTaak', 'showView@NieuweTaakController');

My controller:

class NieuweProductController extends BaseController{


public function showView()
{
    return View::make('newTask');
}

}

But somehow when i click the link it gives a NotFoundHTTP exception

Was it helpful?

Solution

Your class is NieuweProductController, while your rout says NieuweTaakController

I think you should correct it to (or change the class name):

Route::get('NieuweTaak', 'NieuweProductController@showView');

Btw, action goes after the controller name, it's className@method

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top