Reputation: 1906
Blocked by the fact that OVH can't deploy .Net websites, we have turned to use Laravel (to use MVC).
so I have created a controller and I need to call it's methods from my layout, I tried this :
<a class="nav-link" href="{{action('HomeController@WhoWeAre')}}"><span style="text-decoration: underline;"><B>Acceuil</B></span></a>
where HomeContoller is my controller, and WhoWeAre is a method.
when I run my app, the website crash and I get this message :
ErrorException in UrlGenerator.php line 589: Action App\Http\Controllers\HomeController@WhoWeAre not defined. (View: C:\xampp\htdocs\laravel\resources\views\welcome.blade.php)
How can that be corrected, please?
Upvotes: 0
Views: 934
Reputation: 1906
The Solution is just add a new route in web.php :
Route::get('/whoweare', 'HomeController@WhoWeAre');
Upvotes: 1
Reputation: 701
Please try following
Route::get('/WhoWeAre', 'HomeController@WhoWeAre')->name('WhoWeAre');
<a class="nav-link" href="{{ route('WhoWeAre') }}"><span style="text-decoration: underline;"><B>Acceuil</B></span></a>
Upvotes: 0