Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Render a View Script to a Variable

How can I render a view script into a variable within an action controller?

I want to render a view and insert it into a database table as a string.

I am using Zend Framework 1.11

like image 706
voidstate Avatar asked Dec 01 '22 22:12

voidstate


1 Answers

From your controller you can do:

$view = new Zend_View();
$view->some_var = "some_value";
// ... more variable assignments

$output = $view->render('some script');

Then you can store $output in your database.

like image 189
ziad-saab Avatar answered Jan 12 '23 10:01

ziad-saab