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.
To:
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;
any thought on this?
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).
Rather than playing with the data, you can use php output buffering.
I have never tried it on rendering an area, but use this technique often, particularly in widget helpers and plugin systems.
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.
thanX john, this was exactly what i want.