Commit | Line | Data |
---|---|---|
44d399bc S |
1 | <?php |
2 | /** | |
3 | * Zend Framework (http://framework.zend.com/) | |
4 | * | |
5 | * @link http://github.com/zendframework/zf2 for the canonical source repository | |
6 | * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) | |
7 | * @license http://framework.zend.com/license/new-bsd New BSD License | |
8 | */ | |
9 | ||
10 | namespace Zend\Mvc\Controller\Plugin; | |
11 | ||
12 | use Zend\Http\Response; | |
13 | use Zend\View\Model\ViewModel; | |
14 | ||
15 | class CreateHttpNotFoundModel extends AbstractPlugin | |
16 | { | |
17 | /** | |
18 | * Create an HTTP view model representing a "not found" page | |
19 | * | |
20 | * @param Response $response | |
21 | * | |
22 | * @return ViewModel | |
23 | */ | |
24 | public function __invoke(Response $response) | |
25 | { | |
26 | $response->setStatusCode(404); | |
27 | ||
28 | return new ViewModel(['content' => 'Page not found']); | |
29 | } | |
30 | } |