本文整理汇总了PHP中FileReader::getEventsForTeam方法的典型用法代码示例。如果您正苦于以下问题:PHP FileReader::getEventsForTeam方法的具体用法?PHP FileReader::getEventsForTeam怎么用?PHP FileReader::getEventsForTeam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileReader
的用法示例。
在下文中一共展示了FileReader::getEventsForTeam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
require_once './eagle/models/Comment.php';
require_once './eagle/models/Defense.php';
require_once './eagle/models/PitScouting.php';
$app->group('/team', function () {
$this->get('/{url:.*\\/}', function ($req, $res, $args) {
header('Location:/team/' . trim($args['url'], '/'));
exit;
});
$this->get('/{team:[0-9]{1,4}}', function ($req, $res, $args) {
Auth::redirectIfNotLoggedIn();
$team = FileReader::getTeam($args['team']);
if (!$team) {
Downloader::getTeam($args['team']);
header('Refresh:0');
}
$events = FileReader::getEventsForTeam($args['team']);
if (!$events) {
Downloader::getEventsForTeam($args['team']);
header('Refresh:0');
}
$comments = Comment::where('team_id', $team->team_number);
$defense = Defense::where('team_id', $args['team'])->orderBy('id', 'desc')->first();
$defenses = array();
$author = $defense ? $defense->author : false;
if ($defense) {
$defenses['Low Bar'] = $defense->low_bar;
$defenses['Portcullis'] = $defense->portcullis;
$defenses['Cheval de Frsie'] = $defense->cheval_de_frise;
$defenses['Moat'] = $defense->moat;
$defenses['Ramparts'] = $defense->ramparts;
$defenses['Drawbridge'] = $defense->drawbridge;