Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F8896188
index.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
index.php
View Options
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Javelin Example: Tic Tac Toe</title>
<script type="text/javascript">var __DEV__ = true;</script>
<script src="../../pkg/init.dev.js" type="text/javascript"></script>
<style type="text/css">
.tictac {
border: 2px solid black;
cursor: pointer;
text-align: center;
font-size: 36px;
width: 100px;
height: 100px;
font-weight: bold;
}
.status {
text-align: center;
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/JavelinHelper.php'
;
$table
=
array
();
$table
[]
=
'<tr>'
;
$table
[]
=
JavelinHelper
::
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
[]
=
JavelinHelper
::
renderTag
(
'td'
,
''
,
array
(
'class'
=>
'tictac'
,
'meta'
=>
array
(
'pos'
=>
$y
*
3
+
$x
),
'sigil'
=>
'tic-tac-cell'
,
'mustcapture'
=>
true
,
));
}
$table
[]
=
'</tr>'
;
}
echo
JavelinHelper
::
renderTag
(
'table'
,
implode
(
"
\n
"
,
$table
),
array
(
'sigil'
=>
'tic-tac-board'
,
));
JavelinHelper
::
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
JavelinHelper
::
renderHTMLFooter
();
?>
</html>
File Metadata
Details
Attached
Mime Type
text/html
Expires
Fri, Jun 11, 10:46 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
3391411
Default Alt Text
index.php (1 KB)
Attached To
rJX Javelin
Event Timeline
Log In to Comment