<?php $app = require '../../../app/inc.php';
use App\Teamtable\Team;
$item = filter_input(INPUT_GET, 'item', FILTER_VALIDATE_INT);
$model = $app->model('Teamtable');
// item is NULL if not set
if ($item !== NULL)
{
// check that team exists
$team = $model->get($item);
if (!$team)
// team does not exist
$app->session->flash('Kunne ikke endre lag: Lag finnes ikke', 'danger');
$app->redirect('index.php');
}
// lets create a team
$app->view('template/header', ['title' => 'Endre lagdetaljer']);
$app->view('pages/teamtable/edit/update', ["team" => new Team]);
$app->view('template/footer');