pdf-l4 icon indicating copy to clipboard operation
pdf-l4 copied to clipboard

Cannot pass value to view bldade and render HTML

Open bishwarupdas opened this issue 10 years ago • 4 comments

I am creating pdf in controller, When I use View::make('invoice.view') to load html it works fine.

$pdf = new \Thujohn\Pdf\Pdf(); $content = $pdf->load(View::make('invoice.view'))->output(); File::put($compete_file_path, $content);

But when I pass data to view, it throws error

$pdf = new \Thujohn\Pdf\Pdf(); $pdf->load(View::make('invoice.aaa')->with(array($name = 'varun')))->output(); File::put($compete_file_path, $content);

Error: Symfony \ Component \ Debug \ Exception \ FatalErrorException Method Illuminate\View\View::__toString() must not throw an exception

bishwarupdas avatar Mar 23 '14 12:03 bishwarupdas

Maybe array($name => 'varun') instead of array($name = 'varun') ?

thujohn avatar Mar 23 '14 20:03 thujohn

I have this error Method Illuminate\View\View::__toString() must not throw an exception. I manage to past data on Get method, but when using post method, it got error

Raywin88 avatar May 22 '14 02:05 Raywin88

What's your code ?

thujohn avatar May 22 '14 07:05 thujohn

i have same problem. I got error if i passed data from method post.

aakiky avatar Nov 24 '14 08:11 aakiky