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\HttpKernel\HttpKernelInterface;
15 use Symfony\Component\HttpFoundation\Request;
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
31 * The current controller.
35 public function __construct(HttpKernelInterface $kernel, callable $controller, Request $request, $requestType)
37 parent::__construct($kernel, $request, $requestType);
39 $this->setController($controller);
43 * Returns the current controller.
47 public function getController()
49 return $this->controller;
53 * Sets a new controller.
55 * @param callable $controller
57 public function setController(callable $controller)
59 $this->controller = $controller;