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

[SOLVED]how to fetch view result?

I tried to generate mail body with view.

$view = new \Phalcon\Mvc\View\Simple();
//registerEngines
$view->registerEngines(['.volt' => 'volt',]);
//setViewsDir
$viewSrc->setViewsDir('/someDir/');
//render /someDir/mailBody.volt
$mailBody = $view->render('mailBody');

but $mailBody is null.

In smarty.

$mailBody = $smarty->fetch('mailBody.tpl');

What should I do in phalcon?



404

$this->view->getRender("controller", "action"); https://docs.phalcon.io/en/latest/api/Phalcon_Mvc_View.html



2.9k
Accepted
answer

Sorry reply is delayed. Although I have not yet resolved the problem, Because there is a similar thread, https://forum.phalcon.io/discussion/566/storing-a-views-content We would like to refer to.