Last active
March 10, 2020 15:23
-
-
Save MarionLeHerisson/021e64866630ed2a81a719f2d8c8865c to your computer and use it in GitHub Desktop.
Soft. Arch. Heuristics - Exercice 3 : smart Hello World
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @Route("helloworld-{name} */ | |
public function helloWorldAction($name) | |
{ | |
$now = date('H'); | |
if ($now >= 6 && $now < 12) { | |
die('Good morning ' . $name . '!'); | |
} | |
else if ($now >= 12 && $now < 20) { | |
die ('Good afternoon ' . $name . '!'); | |
} | |
die ('Good night ' . $name . '!'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment