render result to variable

I need to create pdf file.

For this purpose I am using tcpdf.

I have already View displayed as html page. Instead I want to render result not to the screen, but to the variable.

Something like

$var = renderPartial(‘NameOfView’);

And then use variable $var to put it into pdf.

Something like

$pdf->writeHTML($var, true, false, false, false, ‘’);

http://www.yiiframework.com/doc/api/1.1/CController#renderPartial-detail

3rd argument ;)

Check the documentation for renderPartial() - http://www.yiiframework.com/doc/api/1.1/CController#renderPartial-detail

If you want to render a view with a variable you can use

$var = renderPartial("$NameOfView");

With “” instead ‘’