How To Reuse A View From Console App

hi, I’m creating a console command that creates and email a pdf report.

Because I have the report generated in a view of a model, I want to know if it’s possible to re-use that view from the console command.

Any suggestion ?

Best Regards


Is the view just one page? Or did you use a cgridview (or such a thing) with more than one page on the view?

If not, you could maybe use a call of the website, read the html-page and send it to a library for creating the pdf. The result should be send through phpmailer, for example.

But that’s just a tip, I don’t know, if it could help you.