model->find($id); if ($item === null) { $this->notFound(); return; } $this->render('views/item_view.php', ['item' => $item]); } /** * Display the index view with data. * * Retrieves data from the model and renders the index view. * * @return void */ public function index(): void { $data = $this->model->getData(); $this->render('views/example_view.php', ['data' => $data]); } }