Bundle/WidgetBundle/Controller/WidgetController.php
public function showAction(Request $request, Widget $widget, $viewReferenceId)
    {
        try {
            $view = $this->get('victoire_page.page_helper')->findPageByParameters(['id' => $viewReferenceId]);
            $this->get('victoire_widget_map.builder')->build($view);
            $this->get('victoire_core.current_view')->setCurrentView($view);
            $response = new JsonResponse([
                    'html'    => $this->get('victoire_widget.widget_renderer')->render($widget, $view),
                    'update'  => 'vic-widget-'.$widget->getId().'-container',
                    'success' => true,
                ]
            );
        } catch (Exception $ex) {
            $response = $this->getJsonReponseFromException($ex);
        }

        return $response;
    }
public function showAction(Request $request, Widget $widget, $viewReferenceId)
    {
        try {
            $view = $this->get('victoire_page.page_helper')->findPageByParameters(['id' => $viewReferenceId]);
            $this->get('victoire_widget_map.builder')->build($view);
            $this->get('victoire_core.current_view')->setCurrentView($view);
            $response = new JsonResponse([
                    'html'    => $this->get('victoire_widget.widget_renderer')->render($widget, $view),
                    'update'  => 'vic-widget-'.$widget->getId().'-container',
                    'success' => true,
                ]
            );
        } catch (Exception $ex) {
            $response = $this->getJsonReponseFromException($ex);
        }

        return $response;
    }
public function showAction ( Request $ request , Widget $ widget , $ viewReferenceId ) { try { $ view = $ this -> get ( 'victoire_page.page_helper' ) -> findPageByParameters ( [ 'id' => $ viewReferenceId ] ) ; $ this -> get ( 'victoire_widget_map.builder' ) -> build ( $ view ) ; $ this -> get ( 'victoire_core.current_view' ) -> setCurrentView ( $ view ) ; $ response = new JsonResponse ( [ 'html' => $ this -> get ( 'victoire_widget.widget_renderer' ) -> render ( $ widget , $ view ) , 'update' => 'vic-widget-' . $ widget -> getId ( ) . '-container' , 'success' => true , ] ) ; } catch ( Exception $ ex ) { $ response = $ this -> getJsonReponseFromException ( $ ex ) ; } return $ response ; }
Show a widget.

@param Request $request
@param Widget  $widget
@param int     $viewReferenceId

@Route("/victoire-dcms-public/widget/show/{id}/{viewReferenceId}", name="victoire_core_widget_show", options={"expose"=true})
@ParamConverter("id", class="VictoireWidgetBundle:Widget")

@throws Exception

@return JsonResponse
Show a widget .