本文整理汇总了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>