<?php

require_once '../../Wact/Loader.inc.php';
Wact_Loader::setupWact();

class MyItem extends Wact_View_Partial {

    function paint() {
?>
    <TR>
        <TD><?php echo $this->myScope->model->First ?></TD>
        <TD><?php echo $this->myScope->model->Last ?></TD>
    </TR>
<?php
    }

}

class MyView extends Wact_View_Root {

    function setUp() {
        $this['ListExample'] = new Wact_View_Repeated();
        $this['ListExample'][] = new MyItem();
    }

    function paint() {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

    <head>
        <title>Simple List Example</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>

    <body>

    <div class="box">
        <h1 align="center">Simple List Example</h1>
        <P align="center">A simple list formatted into a table</P>
          <TABLE BORDER="1" ALIGN="CENTER" CELLPADDING="5">
<?php $this->renderChildren(); ?>
          </TABLE>
    </div>

</body>
</html>
<?php
    }
}


$FoundingFathers =
    array(  array('First' => 'George', 'Last' => 'Washington'),
            array('First' => 'Alexander', 'Last' => 'Hamilton'),
            array('First' => 'Benjamin', 'Last' => 'Franklin'));

$view = new MyView();
$view['ListExample']->setIterator($FoundingFathers);
$view->display();

?>
