<?php
require_once("gagawa.php");
// A set of all common Doctypes are defined as const's
// in the new Doctype class. This example is using
// HTMLStrict.
$d = new Document( Doctype::HTMLStrict );
$div = new Div();
$div->setId("mydiv")->setCSSClass("myclass");
$div->appendChild( new Text("some text in a div") );
$title = new Title();
$title->appendChild( new Text("Page title!") );
// The new Document class defines two public class
// members, a head_ and body_. These Head() and Body()
// objects let the user build a complete HTML page.
$d->head_->appendChild( $title );
$d->body_->appendChild( $div );
echo $d->write();
?>
Special thanks to @namibcoder for reporting this missing piece of important functionality to us on our Google Code homepage.



Did you find this post helpful, or at least, interesting?