/** * @param Request $request * * @return Response */ public function indexAction(Request $request) { $channelCode = $request->query->get('channel'); /** @var ChannelInterface $channel */ $channel = $this->findChannelByCodeOrFindFirst($channelCode); if (null === $channel) { return new RedirectResponse($this->router->generate('sylius_admin_channel_create')); } $statistics = $this->statisticsProvider->getStatisticsForChannel($channel); return $this->templatingEngine->renderResponse('SyliusAdminBundle:Dashboard:index.html.twig', ['statistics' => $statistics, 'channel' => $channel]); }