I just try to create a profile page i create a Route like this:
Route::get('profile/{id}/{name}','ProfileController@index');
and the index function like this :
public function index($id,$name)
{
$user = \App\User::find($id);
return view('pages.profile',compact('user'));
}
profile view:
@extends('app')
@section('content')
<div class="container" style="margin-top: 50px;padding: 30px;">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="proPic"><img src="{{user->image}}" class="img-responsive" alt="Image"></div>
</div>
</div>
</div>
@endsection
but when I lunch the link i get a blank page
If you have a default installation, you probably need to have:
@extends('layouts.app')
instead of
@extends('app')
and change
{{user->image}}
to
{{ $user->image }}
Your code looks clean, a blank page can occur when laravel doesn't displays errors. I'd recommand you to : 1- Check the server response (HTTP code, content...) 2- Check your logs, maybe you'll discover a problem of configuration
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.