Bundle/CoreBundle/Twig/Extension/CmsExtension.php
public function cmsSlotWidgets($slotId, $slotOptions = [])
    {
        $currentView = $this->currentViewHelper->getUpdatedCurrentView();

        $result = '';
        $slotOptions = $this->widgetRenderer->computeOptions($slotId, $slotOptions);

        if ($currentView && !empty($currentView->getBuiltWidgetMap()[$slotId])) {
            //parse the widget maps

            /* @var WidgetMap $widgetMap */
            foreach ($currentView->getBuiltWidgetMap()[$slotId] as $widgetMap) {
                $widget = null;

                try {
                    //get the widget
                    $widget = $this->widgetResolver->resolve($widgetMap);
                    if ($widget) {
                        if (!$widgetMap->isAsynchronous()) {
                            //render this widget
                            $result .= $this->cmsWidget($widget);
                        } else {
                            $result .= $this->widgetRenderer->prepareAsynchronousRender($widget);
                        }
                    }
                } catch (\Exception $ex) {
                    $result .= $this->widgetExceptionHandler->handle($ex, $currentView, $widget);
                }
            }
        }
        //the container for the slot
        $ngSlotControllerName = 'slot'.$slotId.'Controller';
        $ngInitLoadActions = $this->isRoleVictoireGranted() ? sprintf('ng-init=\'%s.init("%s", %s)\'', $ngSlotControllerName, $slotId, json_encode($slotOptions)) : '';
        $result = sprintf(
            '<div class="vic-slot" data-name="%s" id="vic-slot-%s" ng-controller="SlotController as %s" %s>%s</div>',
            $slotId,
            $slotId,
            $ngSlotControllerName,
            $ngInitLoadActions,
            $result
        );

        return $result;
    }
public function cmsSlotWidgets($slotId, $slotOptions = [])
    {
        $currentView = $this->currentViewHelper->getUpdatedCurrentView();

        $result = '';
        $slotOptions = $this->widgetRenderer->computeOptions($slotId, $slotOptions);

        if ($currentView && !empty($currentView->getBuiltWidgetMap()[$slotId])) {
            //parse the widget maps

            /* @var WidgetMap $widgetMap */
            foreach ($currentView->getBuiltWidgetMap()[$slotId] as $widgetMap) {
                $widget = null;

                try {
                    //get the widget
                    $widget = $this->widgetResolver->resolve($widgetMap);
                    if ($widget) {
                        if (!$widgetMap->isAsynchronous()) {
                            //render this widget
                            $result .= $this->cmsWidget($widget);
                        } else {
                            $result .= $this->widgetRenderer->prepareAsynchronousRender($widget);
                        }
                    }
                } catch (\Exception $ex) {
                    $result .= $this->widgetExceptionHandler->handle($ex, $currentView, $widget);
                }
            }
        }
        //the container for the slot
        $ngSlotControllerName = 'slot'.$slotId.'Controller';
        $ngInitLoadActions = $this->isRoleVictoireGranted() ? sprintf('ng-init=\'%s.init("%s", %s)\'', $ngSlotControllerName, $slotId, json_encode($slotOptions)) : '';
        $result = sprintf(
            '<div class="vic-slot" data-name="%s" id="vic-slot-%s" ng-controller="SlotController as %s" %s>%s</div>',
            $slotId,
            $slotId,
            $ngSlotControllerName,
            $ngInitLoadActions,
            $result
        );

        return $result;
    }
public function cmsSlotWidgets ( $ slotId , $ slotOptions = [ ] ) { $ currentView = $ this -> currentViewHelper -> getUpdatedCurrentView ( ) ; $ result = '' ; $ slotOptions = $ this -> widgetRenderer -> computeOptions ( $ slotId , $ slotOptions ) ; if ( $ currentView && ! empty ( $ currentView -> getBuiltWidgetMap ( ) [ $ slotId ] ) ) { //parse the widget maps /* @var WidgetMap $widgetMap */ foreach ( $ currentView -> getBuiltWidgetMap ( ) [ $ slotId ] as $ widgetMap ) { $ widget = null ; try { //get the widget $ widget = $ this -> widgetResolver -> resolve ( $ widgetMap ) ; if ( $ widget ) { if ( ! $ widgetMap -> isAsynchronous ( ) ) { //render this widget $ result .= $ this -> cmsWidget ( $ widget ) ; } else { $ result .= $ this -> widgetRenderer -> prepareAsynchronousRender ( $ widget ) ; } } } catch ( \ Exception $ ex ) { $ result .= $ this -> widgetExceptionHandler -> handle ( $ ex , $ currentView , $ widget ) ; } } } //the container for the slot $ ngSlotControllerName = 'slot' . $ slotId . 'Controller' ; $ ngInitLoadActions = $ this -> isRoleVictoireGranted ( ) ? sprintf ( 'ng-init=\'%s.init("%s", %s)\'' , $ ngSlotControllerName , $ slotId , json_encode ( $ slotOptions ) ) : '' ; $ result = sprintf ( '<div class="vic-slot" data-name="%s" id="vic-slot-%s" ng-controller="SlotController as %s" %s>%s</div>' , $ slotId , $ slotId , $ ngSlotControllerName , $ ngInitLoadActions , $ result ) ; return $ result ; }
render all widgets in a slot.

@param string $slotId
@param string $slotOptions

@return string HTML markup of the widget with action button if needed
render all widgets in a slot .