public function getM($id) { $Faculty = new \app\models\Faculty(); $faculty = $Faculty->getMajor($id); echo json_encode($faculty); }