Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

[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?



1.9k
Accepted
answer

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