Zend 2控制台+渲染模板?

I'm using the Zend console to daemonize some services (like sending emails) but I need to render them via phtml templates. This templates use the url (view helper) and it's not working via the Zend console :

======================================================================
The application has thrown an exception!
======================================================================
Zend\Mvc\Router\Exception\RuntimeException
Request URI has not been set
----------------------------------------------------------------------

Because via the console, there is no URI set like an HTTP request... Is there a clean/easy way to do this ?

Thanks for the help.

Simple patch when Zend Console is used:

  • During routing, retrieve the HttpRouter, if getRequestURI() is not set, then create one and set it.