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