本文整理汇总了PHP中Flight::teams方法的典型用法代码示例。如果您正苦于以下问题:PHP Flight::teams方法的具体用法?PHP Flight::teams怎么用?PHP Flight::teams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flight
的用法示例。
在下文中一共展示了Flight::teams方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteTeam
public function deleteTeam($id)
{
Flight::auth()->check(20);
$team = Flight::teams()->getTeamWithId($id);
$team->delete();
Flight::redirect('/teams');
}
示例2: showEvent
public function showEvent($id)
{
Flight::auth()->check();
$event = Flight::events()->getEventWithId($id);
$team = Flight::teams()->getTeamWithId($event->team);
Flight::util()->render('event', array("event" => $event, "team" => $team));
}
示例3: showNewAbsence
public function showNewAbsence($team, $event)
{
if ($event != null) {
$event = Flight::events()->getEventWithId($event);
}
$team = Flight::teams()->getTeamWithId($team);
Flight::util()->render('newAbsence', array('team' => $team, 'event' => $event));
}
示例4: register
public function register()
{
Flight::auth()->check(20);
$response = Flight::util()->validate("user", Flight::request()->data);
if (is_array($response)) {
Flight::util()->render('newUser', array('error' => $response, "teams" => Flight::teams()->getAllTeams()));
return;
}
$data = Flight::request()->data;
$user = new user($data);
$user->teams = Flight::request()->data->teams;
$user->store();
Flight::redirect("/createUser");
}
示例5: getTeams
public function getTeams()
{
if ($this->role == 20) {
$this->teams = Flight::teams()->getAllTeams();
return $this->teams;
}
$sql = "SELECT team.* FROM team, coach_team WHERE team.id = coach_team.team_id AND coach_team.coach_id = '{$this->id}'";
$result = Flight::db()->query($sql);
$this->teams = array();
if ($result == false) {
return $this->teams;
} else {
while ($row = $result->fetch_assoc()) {
$this->teams[] = new team($row);
}
return $this->teams;
}
}
示例6: showUpdatePlayer
public function showUpdatePlayer($id)
{
Flight::auth()->check();
Flight::util()->render('editPlayer', array('player' => Flight::players()->getPlayerWithId($id), 'teams' => Flight::teams()->getAllTeams()));
}
示例7: foreach
<?php
if (count($players) > 0) {
?>
<table class='table'>
<tr><th>Forename</th><th>Surname</th><th>Team</th><th>Detail</th></tr>
<?php
foreach ($players as $player) {
?>
<tr></td><td><?php
echo $player->forename;
?>
</td><td><?php
echo $player->surname;
?>
</td><td><?php
echo Flight::teams()->getTeamNameWithId($player->team);
?>
</td><td><a href='<?php
Flight::link('/player/' . $player->id);
?>
'>View Details</a></tr>
<?php
}
?>
</table>
<?php
} else {
?>
<h5>No Players in this Team <a href="<?php
Flight::link('/asignPlayer');
?>
示例8: showNewUser
public function showNewUser()
{
Flight::auth()->check(20);
Flight::util()->render('newUser', array("teams" => Flight::teams()->getAllTeams()));
}