Get value of display() method, befor print it

Permalink
hi
how can i get a rendered value of display into a var before print it in a page type?
i checked the method at /concrete/core/models/area.php and there is not such a parameter at display method.
$a = new Area('Main');
$a->display($c);

To:
$a = new Area('Main');
$tmp = $a->display($c);
echo $tmp;

shahroq
 
shahroq replied on at Permalink Reply
shahroq
any thought on this?
haky replied on at Permalink Reply
I don't know the final answer, but sure you couldn't display the content ($tmp) in this way. You can print some information from the area using print_r($a).
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
Rather than playing with the data, you can use php output buffering.
ob_start();
// render the area as usual
$html = ob_get_contents();
ob_end_clean();
echo $html;


I have never tried it on rendering an area, but use this technique often, particularly in widget helpers and plugin systems.
shahroq replied on at Permalink Reply
shahroq
thanX john, this was exactly what i want.