We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Using Volt in CLI Application

Is there a possibility to use volt in a CLI Application using Phalcon?

I don't get it... I'll try it like this:

$content = $view->pick('myview')->start()->render('index', 'index', array())->finish();

The problem is that render needs some params so it tries to compile not that view which I want to. I get the following error (Pathname's cutted):

Notice: Access to undefined property tag in \app\cache\app_views_index.volt.php on line 4

Fatal error: Call to a member function getTitle() on null in \app\cache\app_views_index.volt.php on line 4


207

Chmod \app\cache to 777



7.0k

You must be trolling.

Try using getRender():

$content = $view->pick('myview')->getRender('index', 'index', array());