On 26 Ott, 15:26, Florian <[email protected]> wrote: > In order to get the html result of the action execution, yoi can use > another solution(, which is a way better than the file_get_contents > solution mentionned here:http://www.symfonyexperts.com/question/show/id/141 > ) > > in your action: > > $html = $this->getController()->getPresentattionFor('module', > 'action'); > file_put_contents('/tmp/html.html', $html); > > $snappy = new SnappyPdf; > $snappy->setExecutable('/usr/bin/wkhtml2pdf'); // or whatever else > $snappy->save('/tmp/html.html', '/tmp/pdf.pdf'); > > Hope it works ! ( cause i didn't tested) >
I have already tried this solution, but unfortunately getPresentationFor() doesn't permit to pass in some parameters... :( It only works for module/action without parameters so is unusable in my case, because the view that I need to convert to pdf is generated by an action that receive an Id of the object to generate. Anyway, many thanks. :) -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
