| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*
|
|
|
4 |
* This file is part of the Symfony package.
|
|
|
5 |
*
|
|
|
6 |
* (c) Fabien Potencier <fabien@symfony.com>
|
|
|
7 |
*
|
|
|
8 |
* For the full copyright and license information, please view the LICENSE
|
|
|
9 |
* file that was distributed with this source code.
|
|
|
10 |
*/
|
|
|
11 |
|
|
|
12 |
namespace Symfony\Component\HttpKernel\Event;
|
|
|
13 |
|
|
|
14 |
use Symfony\Component\HttpFoundation\Request;
|
|
|
15 |
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* Allows to create a response for the return value of a controller.
|
|
|
19 |
*
|
|
|
20 |
* Call setResponse() to set the response that will be returned for the
|
|
|
21 |
* current request. The propagation of this event is stopped as soon as a
|
|
|
22 |
* response is set.
|
|
|
23 |
*
|
|
|
24 |
* @author Bernhard Schussek <bschussek@gmail.com>
|
|
|
25 |
*/
|
|
|
26 |
final class ViewEvent extends RequestEvent
|
|
|
27 |
{
|
|
|
28 |
public readonly ?ControllerArgumentsEvent $controllerArgumentsEvent;
|
|
|
29 |
private mixed $controllerResult;
|
|
|
30 |
|
|
|
31 |
public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, mixed $controllerResult, ControllerArgumentsEvent $controllerArgumentsEvent = null)
|
|
|
32 |
{
|
|
|
33 |
parent::__construct($kernel, $request, $requestType);
|
|
|
34 |
|
|
|
35 |
$this->controllerResult = $controllerResult;
|
|
|
36 |
$this->controllerArgumentsEvent = $controllerArgumentsEvent;
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
public function getControllerResult(): mixed
|
|
|
40 |
{
|
|
|
41 |
return $this->controllerResult;
|
|
|
42 |
}
|
|
|
43 |
|
|
|
44 |
public function setControllerResult(mixed $controllerResult): void
|
|
|
45 |
{
|
|
|
46 |
$this->controllerResult = $controllerResult;
|
|
|
47 |
}
|
|
|
48 |
}
|