Created
July 24, 2013 15:41
-
-
Save ronan-gloo/6071752 to your computer and use it in GitHub Desktop.
Gestion 404 dans les controleurs
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
<?php | |
// Remplacer: | |
if (!$page) { | |
$response = new Response(); | |
$response->setStatusCode(404); | |
return $response; | |
} | |
// Par: | |
if (!$page) { | |
$this->getResponse()->setStatusCode(404); | |
return false; | |
} | |
// Sinon le 404 n'est pas catché par le dispatch listener. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment