Posted by Marcin Dobrucki on 06/22/06 11:28
msch-prv@bluewin.ch wrote:
> I visualize html pages in terms of grids where cells could be filled up
> by html block components. Is this approach somewhat too fancy?
I've had success with using PEAR::HTML_Page2 with a few other HTML_*
packages. For example, I have classes that handles Users, and has a
function "getForm". That produces a QuickForm object which I can then
dump into the HTML_Page along these lines:
$p = new HTML_Page2();
....
$u = new User(/* params */);
if ($show_form) {
$p->addBodyContent($u->getForm());
}
....
$p->display();
It took a while to hone this on a bigger scale, but now making GUI
changes is very quick and simple. It has an aditional benefit of not
having to buffer output because everything is inserted into the page
object, and its display is the last part of the script. So I never get
a "header already sent" problem. Anytime before $p->display() you can
re-direct, and do something else.
/marcin
[Back to original message]
|