// load controller
if (false ===
$controller =
$this->resolver->
getController($request)) { throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.',
$request->
getPathInfo()));
} $event =
new ControllerEvent($this,
$controller,
$request,
$type);
$this->dispatcher->
dispatch($event, KernelEvents::CONTROLLER
);
$controller =
$event->
getController();
// controller arguments
$arguments =
$this->argumentResolver->
getArguments($request,
$controller,
$event->
getControllerReflector());
$event =
new ControllerArgumentsEvent($this,
$event,
$arguments,
$request,
$type);
$this->dispatcher->
dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS
);
$controller =
$event->
getController();
$arguments =
$event->
getArguments();
// call controller
$response =
$controller(...
$arguments);
// view
if (!
$response instanceof Response
) {