public function indexAction(Request $request, $year) { $leapyear = new LeapYear(); if ($leapyear->isLeapYear($year)) { return new Response('Yep, this is a leap year!'); } return new Response('Nope, this is not a leap year.'); }
public function indexAction(Request $request, $year) { $leapyear = new LeapYear(); if ($leapyear->isLeapYear($year)) { $response = new Response('Yep, this is a leap year!'); } else { $response = new Response('Nope, this is not a leap year.'); } $response->setTtl(10); return $response; }
public function indexAction(Request $request, $year) { $leapYear = new LeapYear(); if ($leapYear->isLeapYear($year)) { //return new Response($year.' is leap year'); return 'this is a leap year!'; } else { //return new Response(' is not leap year'); return 'this is not a leap year!'; } }