Last active
December 31, 2015 03:19
-
-
Save juriansluiman/7927143 to your computer and use it in GitHub Desktop.
A Christmas #zf2 easter egg
This file contains 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
<?php | |
namespace EasterEgg; | |
use DateTime; | |
class Module | |
{ | |
public function onBootstrap(MvcEvent $e) | |
{ | |
$today = new DateTime; | |
$christmas = new DateTime('2013-12-24'); | |
$diff = $today->diff($christmas); | |
if ($diff->days !== 0) { | |
return; | |
} | |
$app = $e->getApplication(); | |
$response = $app->getResponse(); | |
$headers = $response->getHeaders(); | |
$headers->addHeaderLine('X-HoHoHo', 'Merry Christmas!'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment