I was wondering (As its not jumping out at me from the documentation) how one would assign a view to a CLI task. This would be used to render text out to stdout, eg a phtml file that may be XML with vars assigned to it. Then rather then echoing out stuff, I could pipe it cleanly to other apps.
$app->getDI()->set('view', function() use ($config) {
$view = new \Phalcon\Mvc\View();
$view->setViewsDir($config->application->viewsDir);
return $view;
});
And the CLI app is not failing. So far so good.. but
Within my task;
$this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
But this results in
PHP Fatal error: Class 'Modules\Cli\Task\View' not found in
Any help/thoughts/examples welcome