Bundle/PageBundle/Controller/BasePageController.php
protected function getViewReferenceRedirect(Request $request, BasePage $page)
    {
        $parameters = [
            'viewId' => $page->getId(),
        ];

        if (!($page instanceof Blog)) {
            $parameters['locale'] = $request->getLocale();
        }

        $viewReference = $this->get('victoire_view_reference.repository')
            ->getOneReferenceByParameters($parameters);

        $page->setReference($viewReference);

        return [
            'success' => true,
            'url'     => $this->generateUrl(
                'victoire_core_page_show',
                [
                    '_locale' => $request->getLocale(),
                    'url'     => $viewReference->getUrl(),
                ]
            ),
        ];
    }
protected function getViewReferenceRedirect(Request $request, BasePage $page)
    {
        $parameters = [
            'viewId' => $page->getId(),
        ];

        if (!($page instanceof Blog)) {
            $parameters['locale'] = $request->getLocale();
        }

        $viewReference = $this->get('victoire_view_reference.repository')
            ->getOneReferenceByParameters($parameters);

        $page->setReference($viewReference);

        return [
            'success' => true,
            'url'     => $this->generateUrl(
                'victoire_core_page_show',
                [
                    '_locale' => $request->getLocale(),
                    'url'     => $viewReference->getUrl(),
                ]
            ),
        ];
    }
protected function getViewReferenceRedirect ( Request $ request , BasePage $ page ) { $ parameters = [ 'viewId' => $ page -> getId ( ) , ] ; if ( ! ( $ page instanceof Blog ) ) { $ parameters [ 'locale' ] = $ request -> getLocale ( ) ; } $ viewReference = $ this -> get ( 'victoire_view_reference.repository' ) -> getOneReferenceByParameters ( $ parameters ) ; $ page -> setReference ( $ viewReference ) ; return [ 'success' => true , 'url' => $ this -> generateUrl ( 'victoire_core_page_show' , [ '_locale' => $ request -> getLocale ( ) , 'url' => $ viewReference -> getUrl ( ) , ] ) , ] ; }
Return an array for JsonResponse redirecting to a ViewReference.

@param Request  $request
@param BasePage $page

@return array
Return an array for JsonResponse redirecting to a ViewReference .