PDF generation is a view. You should return it in appropriate controller.
Thanks for answer:
I have something like this:
Route::get('myusers/{id?}', function($id){
$data = array('as' => 'id', 'uses'
=> 'UserController@showUser');
$html = View::make('myusers')->with('target', $id);
return PDF::load($html, 'A4', 'portrait')->show;
});
That doesn't work, i feel confused on how i can user that.
Thanks.
You need to render first the html:
$html = View::make('myusers')->with('target', $id)->render();
Than you can pass the view to your PDF class.
If you have any further questions you can ask me, I am using also this package. It works great for me.
Do you get any errors?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community