Using web views in console commands


In a web app, I generate PDF with mPDF and it works like a charm. I partialRender HTML views, and feed the generated HTML to Kartik’s mPDF.

HTML views mainly contains DetailViews and GridViews.

Now, Id like to automate this processes and generate the same PDF in batch, through a console command (run by unix cron job).

I created a console command, but when I render some views that contains grid views, etc, I get error messages because web specific aliases such as @web, or @webroot are not defined in console apps. If I try to cheat and force these aliases to some values, I bump into other errors like

Please configure UrlManager::hostInfo correctly as you are running a console application.

So: Is it simply possible to reuse those web app specific views in console apps?

If yes, what extra configuration do I need carry from the web app config to the console app config.

Thank you for your help.

I wish all Yiiers a wonderful 2015 yiiear.