本文整理匯總了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>