This is how it's supposed to work in the documentation:
<?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; class UserController extends Controller { /** * Show the profile for the given user. * * @param int $id * @return Response */ public function showProfile($id) { return view('user.profile', ['user' => User::findOrFail($id)]); } } similar to mine, but mine does'nt work, why?Oh now I get it why nobody's answering. All you nerds live on the other side of the earth. It's night for you right now
I've yet to finish my morning caffeine recharge, but I think the period in the template name makes the path conversion a directory.
'post.new'
would try to load - views\post\new.blade.php
Thanks, that actually helped me a little bit. There can't be dots in filenames in the view-folder
Dots are actually slashes, but a bit more OOP:) - So each dot is a slah with the exception of *.blade.php in the recources/views/ directory.
Switching to swedish, guessing muppbarn is swede:P Det betyder att
return view('user.profile.partials.nav');
laddar in 'recources/views/user/profile/partials/nav.blade.php'
Det är superbra när man ska inkludera och "extenda" i designen blir superlätt att läsa..
ironyh said:
Dots are actually slashes, but a bit more OOP:) - So each dot is a slah with the exception of *.blade.php in the recources/views/ directory.
Switching to swedish, guessing muppbarn is swede:P Det betyder att
return view('user.profile.partials.nav');
laddar in 'recources/views/user/profile/partials/nav.blade.php'
Det är superbra när man ska inkludera och "extenda" i designen blir superlätt att läsa..
Ok, the main question of the thread: The views is supposed to be "returned" from the routes.php and not the controller?
Ok thanks guys, I think I got it now. Anyway it works
Views are called from the controller with return view(file');
return view('forms.register'); means for example folder: forms and file: register.blade.php
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community