当前位置: 首页>>代码示例>>PHP>>正文


PHP FileReader::getTeam方法代码示例

本文整理汇总了PHP中FileReader::getTeam方法的典型用法代码示例。如果您正苦于以下问题:PHP FileReader::getTeam方法的具体用法?PHP FileReader::getTeam怎么用?PHP FileReader::getTeam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileReader的用法示例。


在下文中一共展示了FileReader::getTeam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

<?php

require_once './eagle/utils/Downloader.php';
require_once './eagle/utils/FileReader.php';
require_once './eagle/utils/Auth.php';
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;
开发者ID:ryanp73,项目名称:Eagle,代码行数:31,代码来源:team.routes.php

示例2: function

require_once './eagle/utils/Auth.php';
require_once './eagle/utils/FileReader.php';
require_once './eagle/models/Comment.php';
$app->group('/comment', function () {
    $this->get('/{url:.*\\/}', function ($req, $res, $args) {
        header('Location:/event/' . trim($args['url'], '/'));
        exit;
    });
    $this->get('/new', function ($req, $res, $args) {
        Auth::redirectIfNotLoggedIn();
        $this->view->render($res, 'newComment.html', ['title' => 'New Comment', 'user' => Auth::getLoggedInUser()]);
    });
    $this->post('/new', function ($req, $res, $args) {
        Auth::redirectIfNotLoggedIn();
        $comment = new Comment();
        $comment->user_id = Auth::getLoggedInUser()->id;
        $comment->author = Auth::getLoggedInUser()->name;
        $comment->team_id = $_POST['teamId'];
        $comment->notes = $_POST['notes'];
        $comment->save();
        header('Location:/comment/' . $_POST['teamId']);
        exit;
    });
    $this->get('/{team:[0-9]{1,4}}', function ($req, $res, $args) {
        Auth::redirectIfNotLoggedIn();
        $comments = Comment::where('team_id', $args['team'])->get();
        $title = 'Comments for ' . $args['team'];
        $this->view->render($res, 'teamComments.html', ['title' => $title, 'comments' => $comments, 'team' => FileReader::getTeam($args['team']), 'user' => Auth::getLoggedInUser()]);
    });
});
开发者ID:ryanp73,项目名称:Eagle,代码行数:30,代码来源:comment.routes.php


注:本文中的FileReader::getTeam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。