4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\Event;
14 use Symfony\Component\HttpFoundation\Request;
15 use Symfony\Component\HttpKernel\HttpKernelInterface;
18 * Allows filtering of a controller callable.
20 * You can call getController() to retrieve the current controller. With
21 * setController() you can set a new controller that is used in the processing
24 * Controllers should be callables.
26 * @author Bernhard Schussek <bschussek@gmail.com>
28 class FilterControllerEvent extends KernelEvent
32 public function __construct(HttpKernelInterface $kernel, callable $controller, Request $request, $requestType)
34 parent::__construct($kernel, $request, $requestType);
36 $this->setController($controller);
40 * Returns the current controller.
44 public function getController()
46 return $this->controller;
49 public function setController(callable $controller)
51 $this->controller = $controller;