2022-03-14 19:13:10 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Models\TracksModel;
|
|
|
|
|
|
|
|
class Tracks extends BaseController
|
|
|
|
{
|
2024-04-07 22:40:57 +02:00
|
|
|
private object $tracksModel;
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->tracksModel = new TracksModel();
|
|
|
|
}
|
2022-03-14 19:13:10 +01:00
|
|
|
|
|
|
|
function index($id)
|
|
|
|
{
|
|
|
|
$this->cachePage(3600);
|
2024-04-07 22:40:57 +02:00
|
|
|
$track = $this->tracksModel->data($id);
|
2022-03-14 19:13:10 +01:00
|
|
|
$bestLaps = getBestTimesTrack($id);
|
|
|
|
echo get_header('Track: ' . $track->name);
|
|
|
|
echo view('track', ['track' => $track, 'bestLaps' => $bestLaps]);
|
|
|
|
echo get_footer();
|
|
|
|
}
|
|
|
|
}
|