本文整理汇总了PHP中Tpl::string方法的典型用法代码示例。如果您正苦于以下问题:PHP Tpl::string方法的具体用法?PHP Tpl::string怎么用?PHP Tpl::string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tpl
的用法示例。
在下文中一共展示了Tpl::string方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Deck
<body>
<?php
require_once 'Poker.class.php';
$D = new Deck();
$Table = new Hand();
foreach (range(1, 5) as $i) {
$Table->add($D->draw());
}
$players = range(1, 5);
foreach ($players as $k => $v) {
$hole = new Hand();
$hole->add($D->draw());
$hole->add($D->draw());
$players[$k] = $hole;
}
$center = new HTMLTag("center", $Table->show());
echo $center->parse();
echo "\n<hr />\n";
$full = array();
$WIN = Poker::rankHands($Table, $players, $full);
echo "<h2>" . intval(count($WIN)) . " winner(s)</h2>\n\n";
foreach ($players as $i => $h) {
$out = Tpl::string('<div class="container{WINNER}">{HAND}<br />{EVAL}</div>');
$win = in_array($i, $WIN);
$out->setAttribs(array('WINNER' => $win ? ' winner' : '', 'HAND' => $h->show(), 'EVAL' => $full[$i]->rankName() . "<br />" . $full[$i]->printRun()));
echo $out->parse();
}
?>
</body>
</html>