public function command($option) { $student = new studentController(); switch ($option) { case "insert": $student->getViewInsertStudent(); include_once 'Views/insertStudent.php'; break; case "edit": $getStudent = $student->viewStudentById($this->id); include_once 'Views/editStudent.php'; break; case "delete": $student->viewStudent(); include_once 'Views/editStudent.php'; break; default: $student->viewStudent(); include_once 'Views/studentView.php'; break; } }
<?php include_once "config.php"; include_once "Controller/studentController.php"; connectToDatabase(); $studentcontroller = new studentController(); $studentcontroller->inVoke();