0
HTMLページをpdfに変換したいのですが、できません。多分あなたは私が間違っていることを知っているでしょうか?ここに私のコードLaravelのdompdfを使用してテーブルを変換できません
web.phpある
Route::get('print/{id}',array('as'=>'htmltopdfview','uses'=>'[email protected]'));
コントローラ:
public function htmltopdfview(Request $request)
{
$products = Client::all();
view()->share('products',$products);
if($request->has('download')){
$pdf = PDF::loadView('client/print');
return $pdf->download('client/print');
}
return view('client/print' compact('client'));
}
とビュー:だから最初
<a href="{{ route('htmltopdfview',['download'=>'pdf']) }}">Download PDF</a>
<div class="panel-body">
{!! Form::open(['action' => ['[email protected]', $client->id]]) !!}
{!! Form::label('name', 'Imie i nazwisko:'); !!}
{!! Form::text('name', null, ['class' => 'form-control']) !!}
{!! Form::submit('Edit!', ['class' => 'btn btn-success']) !!}
{!! Form::close() !!}
私は次のようなことをしました: public function htmltopdfview(Request $ request) { $ products = Client :: all(); view() - > share( 'products'、$ products); ; $ pdf = PDF :: loadView( 'home'); return $ pdf-> stream(); } と私のページは読み込み中だけです... –