color: #666666; } </style> </head> <body> <p>This is a simple Tic-Tac-Toe game using Javelin and PHP.</p> <p>Click a square to make the first move.</p> <?php require_once '../../support/php/Javelin.php'; $table = array(); $table[] = '<tr>'; $table[] = Javelin::renderTag('td', 'Your move.', array('sigil' => 'tic-tac-status', 'class' => 'status', 'colspan' => '3')); for ($y = 0; $y < 3; $y++) { $table[] = '<tr>'; for ($x = 0; $x < 3; $x++) { $table[] = Javelin::renderTag('td', '', array('class' => 'tictac', 'meta' => array('pos' => $y * 3 + $x), 'sigil' => 'tic-tac-cell', 'mustcapture' => true)); } $table[] = '</tr>'; } echo Javelin::renderTag('table', implode("\n", $table), array('sigil' => 'tic-tac-board')); Javelin::initBehavior('tic-tac-toe'); ?> </body> <script src="../../pkg/javelin.dev.js" type="text/javascript"></script> <script src="tic-tac-toe.js" type="text/javascript"></script> <?php echo Javelin::renderHTMLFooter(); ?> </html>