We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Assign view to a variable

Hi all

i want to send an email , and there will be html . On codeigniter i can make with that

$html_email = $this->load->view($this->theme.'mail/davetiye_mail_header', $data, true);
$html_email .= '    <tr>
    <td><a href="'.base_url().'"><img src="'.$this->mail_theme_url.'i/davetiye/ust.jpg"  /></a></td>

i mean i dont want to set html in controller so i want to assign it on variable and then send it . How can i make that?

edited Oct '14

I've done something like in this way:

die($this->view->getRender('view', params);

I hope it helps!


i will assign $html = $this->view->getRender('view',array()) ?