Hello,
I try to create email template to user to edit the template and see the preview, I will show 2 variable which is $template that get a collect-review.volt content and $template-rendered that rendered by volt engine to display the preview.
After run getRender, I get a blank page. Is it possible to do this?
public function getTemplate()
{
$params = array();
$parameters = array_merge(array(
'name' => 'myname',
), $params);
return $this->view->getRender('emailtemplates', 'collect_review', $parameters, function($view){
$view->setRenderLevel(View::LEVEL_LAYOUT);
});
}
public function collectTemplateAction()
{
$auth = $this->session->get('auth');
$shop = Shops::findByOwner($auth[id]);
$this->view->setVar("shop", $shop);
$this->view->setVar("name", 'warut');
$template = file_get_contents('../apps/frontend/views/emailtemplates/collect-review.volt');
$template_rendered = $this->getTemplate();
//echo 'aa'.$template_rendered;
$this->view->setVar("template", $template);
//$this->view->setVar("template_rendered", $template_rendered);
//$this->view->disable();
}
Thanks,