public function saveSportAction() { $spr = new en\Sport(); $sportName = $_POST["sportname"]; $sportId = $_POST["sportid"]; if ($sportName == NULL) { echo "Please enter valid a Sport Name"; return $this->render('SportBundle:AddSport:addSport.html.twig'); } else { $spr->setName($sportName); $spr->setSportId($sportId); cont\SportDBaccess::saveSport($spr); return $this->render('SportBundle:Message:dbsave.html.twig'); } }
public function indexAction() { $sportList = SportDBaccess::getAllSports(); return $this->render('applicationStudentBundle:Default:AddStudentSPD.html.twig', array('sportList' => $sportList)); }