Render the home page.

@param Request $request
@return Response
326743
public function homeAction(Request $request)
    {
        /** @var BlockManager $manager */
        $manager  = $this->get('opifer.content.content_manager');
        $host = $request->getHost();
        $em = $this->getDoctrine()->getManager();

        $siteCount = $em->getRepository(Site::class)->createQueryBuilder('s')
            ->select('count(s.id)')
            ->getQuery()
            ->getSingleScalarResult();

        $domain = $em->getRepository(Domain::class)->findOneByDomain($host);

        if ($siteCount && $domain->getSite()->getDefaultLocale()) {
            $request->setLocale($domain->getSite()->getDefaultLocale()->getLocale());
        }

        if (!$domain && $siteCount > 1) {
            return $this->render('OpiferContentBundle:Content:domain_not_found.html.twig');
        }

        $content = $manager->getRepository()->findActiveBySlug('index', $host);

        return $this->forward('OpiferContentBundle:Frontend/Content:view', [
            'content' => $content
        ]);
    }
662573
public function pagerfanta(Request $request)
    {
        $sql = $this->createQueryBuilder('data');
        $sql->select('data');
        $sql->andWhere('data.uploadFile = :uploadFile');
        $sql->setParameter('uploadFile', $request->get('import_id'));

        switch ($request->get('type', 'all')) {
            case 'success':
                $sql->andWhere('data.status = 1 or data.status = 2 or data.status = 0');
                break;
            case 'nochanges':
                $sql->andWhere('data.status = 0');
                break;
            case 'new':
                $sql->andWhere('data.status = 1');
                break;
            case 'update':
                $sql->andWhere('data.status = 2');
                break;
            case 'error':
                $sql->andWhere('data.status = 3');
                break;
        }

        return $sql->getQuery();
    }
863242
public function indexAction(Request $request)
    {
        try {
            $configurator = $this->get('phlexible_element_renderer.configurator');
            $configuration = $configurator->configure($request);
            if ($configuration->hasResponse()) {
                return $configuration->getResponse();
            }
            $data = $configuration->getVariables();

            $template = $data['template'];
            if ($request->attributes->has('template')) {
                $template = $request->attributes->get('template');
            }

            return $this->render($template, (array) $data);

        } catch (NotFoundHttpException $e) {
            $nodeId                 = $this->get('phlexible_siteroot.siteroot_request_matcher')->matchRequest($this->getRequest())->getSpecialTid($request->getLocale(), 'error_' . $e->getStatusCode());
            $contentTreeNode        = $this->get('phlexible_tree.content_tree_manager')->findByTreeId($nodeId)->get($nodeId);
            $url                    = $this->get('router')->generate($contentTreeNode);

            return new RedirectResponse($url);
        }
    }
846349
public function addHomepageAction(Request $request)
    {
        $this->init($request);

        // Check with Acl
        $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN');

        $type = $this->validatePageType($request);

        $newPage = $this->createNewPage($request, $type);

        /* @var Node $nodeNewPage */
        $nodeNewPage = $this->em->getRepository('KunstmaanNodeBundle:Node')
            ->createNodeFor($newPage, $this->locale, $this->user);
        $nodeTranslation = $nodeNewPage->getNodeTranslation(
            $this->locale,
            true
        );
        $this->em->flush();

        // Set default permissions
        $this->container->get('kunstmaan_node.acl_permission_creator_service')
            ->createPermission($nodeNewPage);

        $nodeVersion = $nodeTranslation->getPublicNodeVersion();

        $this->get('event_dispatcher')->dispatch(
            Events::ADD_NODE,
            new NodeEvent(
                $nodeNewPage, $nodeTranslation, $nodeVersion, $newPage
            )
        );

        return $this->redirect(
            $this->generateUrl(
                'KunstmaanNodeBundle_nodes_edit',
                array('id' => $nodeNewPage->getId())
            )
        );
    }
543539
public function homeAction(Request $request)
    {
        // TODO check if AuthenticationCredentialsNotFoundException is raised without a cookie.
        if (!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
            $request->getSession()->set('_ekyna.login_success.target_path', 'fos_user_profile_show');
            return $this->redirect($this->generateUrl('fos_user_security_login'));
        }
        return $this->redirect($this->generateUrl('fos_user_profile_show'));
    }
1314481
public function contentAction(Request $request)
    {
        return $this->render('OpiferCmsBundle:CKEditor:content.html.twig', [
            'funcNum' => $request->get('CKEditorFuncNum'),
            'CKEditor' => $request->get('CKEditor'),
            'type' => $request->get('type'),
        ]);
    }
678489
public function render(Request $request, array $options = array())
    {
        return $this->doRender(
            $options + array(
                'app_id' => $this->appId,
                'width' => $this->defaultWidth,
                'num_posts' => $this->defaultNumPosts,
                'color_scheme' => $this->defaultColorScheme,
                'include_sdk' => $this->defaultIncludeSDK,
                'url' => $request->getSchemeAndHttpHost() . $request->attributes->get('semanticPathinfo', $request->getPathInfo()),
            )
        );
    }
12227
public function render(Eresus_CMS_Request $request)
    {
        Eresus_Kernel::log(__METHOD__, LOG_DEBUG, '()');
        return $this->renderUI($request);
    }
956443
public function render($request)
    {
        if (str_is('api.*', $request->getHost()) || $request->wantsJson()) {
            return response()->json(['message' => $this->getMessage()], 400);
        }
        return abort(500, '<strong>Whoops!</strong> Something went wrong!');
    }
460343
public function renderBlockAction(Request $request)
    {
        if (false === $this->get('sonata.dashboard.admin.block')->isGranted('LIST')) {
            throw $this->createAccessDeniedException();
        }

        $id = $request->get($this->admin->getIdParameter());

        $block = $this->get('sonata.dashboard.admin.block')->getObject($id);

        if (!$block) {
            throw $this->createNotFoundException(sprintf('unable to find the block with id : %s', $id));
        }

        $content = $this->container->get('templating')->render('@CompoSonataDashboard/Dashboard/single_block.html.twig', [
            'block' => $block,
            'request' => $request,
        ]);

        $response = new Response();

        $response->setContent($content);

        return $response;
    }
303306
public function listAction(Request $request): Response
    {
        $currentPage = $request->query->getInt(self::PAGINATION_PARAM_NAME, 1);

        $contentDraftsDataset = $this->datasetFactory->contentDrafts();
        $contentDraftsDataset->load();

        $pagination = new Pagerfanta(
            new ArrayAdapter($contentDraftsDataset->getContentDrafts())
        );
        $pagination->setMaxPerPage($this->defaultPaginationLimit);
        $pagination->setCurrentPage(min($currentPage, $pagination->getNbPages()));

        $removeContentDraftForm = $this->formFactory->removeContentDraft(
            $this->createContentRemoveData($pagination)
        );

        return $this->render('@ezdesign/admin/content_draft/list.html.twig', [
            'pager' => $pagination,
            'form_remove' => $removeContentDraftForm->createView(),
        ]);
    }
966003
public function render($request, Exception $e)
	{
		if ($e instanceof HttpException) {
			$response = $e->response();
			
			if ($request->header('Origin')) {
				Cors::attachHeaders($response);
				$response->headers->set('Access-Control-Allow-Origin', $request->header('Origin'));
			}
			
			return $response;
		}
		
		return parent::render($request, $e);
	}
1067440
public function loadPages($request)
    {
        $pageMapper = ($this->dataMapper)('pageMapper');

        // Fetch all published pages
        $this->pages = $pageMapper->findPages();

        // Set flag on page for current request
        $url = $request->getUri()->getPath();
        // Check if home page '/' to match slug name
        $url = ($url === '/') ? 'home' : ltrim($url, '/');
        $key = array_search($url, array_column($this->pages, 'slug'));

        if (is_numeric($key)) {
            $this->pages[$key]->currentPage = true;
        }

        return;
    }
965849
public function indexDataAction(Request $request)
        {

            $aRemoteApps = RemoteAppQuery::create()->find();
            $sResult     = $this->renderView('SlashworksAppBundle:RemoteApp:data.json.twig', array(
                'entities' => $aRemoteApps,
            ));

            $response = new Response($sResult);
            $response->headers->set('Content-Type', 'application/json');

            return $response;

        }
1194726
public function phpAction(Request $request)
    {
        $show = $request->query->get('show', -1);

        ob_start();
        phpinfo($show);
        $output = ob_get_clean();

        return new Response($output);
    }
38986
public function indexAction(Request $request)
    {
        $response = new Response();
        try {
            $this->channelContext->getChannel();
        } catch (ChannelNotFoundException $e) {
            $response->headers->setCookie(new Cookie('_channel_code', $this->fallbackChannelCode));
            $request->query->set('_channel_code', $this->fallbackChannelCode);
        }

        return $this->templating->renderResponse('@SyliusShop/Homepage/index.html.twig', [], $response);
    }
74123
public function markAllAsReadAction(Request $request): Response
    {
        $configuration = $this->requestConfigurationFactory->create($this->metadata, $request);
        $this->isGrantedOr403($configuration, ResourceActions::UPDATE);

        $this->messageManager->markAllAsRead($this->getUser());

        if (!$configuration->isHtmlRequest()) {
            return $this->viewHandler->handle($configuration, View::create(null, Response::HTTP_NO_CONTENT));
        }

        $this->flashHelper->addSuccessFlash($configuration, ResourceActions::UPDATE);

        return $this->redirectHandler->redirectToIndex($configuration);
    }