本文整理匯總了PHP中Division::get_name方法的典型用法代碼示例。如果您正苦於以下問題:PHP Division::get_name方法的具體用法?PHP Division::get_name怎麽用?PHP Division::get_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Division
的用法示例。
在下文中一共展示了Division::get_name方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Team
require_once 'classes/division.php';
require_once 'classes/conference.php';
//read parameter from url
$id = $_GET['id'];
try {
//create object with data
$t = new Team($id);
$d = new Division($t->get_div_id());
$c = new Conference($d->get_conf_id());
$json = '{"status" : 0,
"id" : "' . $t->get_id() . '",
"name" : "' . $t->get_city() . '",
"image":"' . $t->get_image() . '",
"division":{';
$json .= '"id":"' . $d->get_id() . '",
"name":"' . $d->get_name() . '",
"conference":
{';
$json .= '"id":"' . $c->get_id() . '",
"name":"' . $c->get_name() . '",
"image":"' . $c->get_image() . '"
}},
"players" : [';
//display divisions
$first = true;
//first record
foreach ($t->get_players() as $pl) {
//add comma separator before each row except for the first row
if ($first) {
$first = false;
示例2: Division
require_once 'classes/division.php';
require_once 'classes/exceptions.php';
//read parameter from url
$id = $_GET['id'];
try {
//create object with data
$d = new Division($id);
?>
<html>
<head>
</head>
<body>
<table border="1px">
<tr>
<td><?php
echo $d->get_name();
?>
</td>
</tr>
</table>
<table border="1px">
<tr><td>Teams</td></tr>
<?php
foreach ($d->get_teams() as $t) {
echo '<tr><td><img src="Images/Teams/' . $t->get_image() . '"</td><td>' . $t->get_name() . '</td></tr>';
}
?>
</table>
</body>
</html>