Skip to content

Instantly share code, notes, and snippets.

@juriansluiman
Last active December 31, 2015 03:19
Show Gist options
  • Save juriansluiman/7927143 to your computer and use it in GitHub Desktop.
Save juriansluiman/7927143 to your computer and use it in GitHub Desktop.
A Christmas #zf2 easter egg
<?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