public function detailAction($id) { // find id of selected appointment $afspraak = Afspraak::findById($id); // variable to display all users from the model Gebruiker $this->view->gebruiker = Gebruiker::find(); // variable to display all Behandelingen from the model Behandeling $this->view->behandeling = Behandeling::find(); // make variable accessible for the view $this->view->setVar('afspraak', $afspraak); $this->view->setVar('id', $id); }