function show_action($id) { $model = new EventsModel(); $event = $model->get_event($id); if (isset($_POST['subscribe'])) { $model = new UsersModel(); $result = $model->subscribe_to($id); if ($result) { header('Location: ./pupils?event=' . $id); exit; } } $html = $this->render_template('application/view/templates/show.php', array('event' => $event)); return $html; }