# Unable to render template from CLI

**URL:** <https://discourse.laminas.dev/t/unable-to-render-template-from-cli/3345>\
**Category:** Components & MVC\
**Tags:** laminas-mvc, laminas-cli\
**Created:** [June 1, 2023, 11:22am UTC](https://discourse.laminas.dev/t/unable-to-render-template-from-cli/3345 "2023-06-01T11:22:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danielss89](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/danielss89/32/1513_2.png) [@Danielss89](https://discourse.laminas.dev/u/Danielss89)\
**Post date:** [June 1, 2023, 11:22am UTC](https://discourse.laminas.dev/t/unable-to-render-template-from-cli/3345/1 "2023-06-01T11:22:42Z")

</div>

I am doing some upgrading, and i am now having problems with rendering from the CLI. I have a cli command which pushes a notification to a user through websocket, and this notification is rendered with the ViewRenderer.  
I am now getting this error: “PHP Fatal error: Uncaught Error: Call to a member function getRouteMatch() on null in /app/vendor/laminas/laminas-mvc/src/Service/ViewHelperManagerFactory.php:91”  
Which kinda makes sense, as it’s CLI so there is no route-match. I guess it happens because i use $this-\>url(‘xxx’) in the template, to generate a link(this should still work in CLI though?)

Is there a config i need to change or is this a bug?
