Bundle/WidgetBundle/Renderer/WidgetRenderer.php
public function computeOptions($slotId, $options = [])
    {
        $slots = $this->container->getParameter('victoire_core.slots');

        $availableWidgets = $this->container->getParameter('victoire_core.widgets');
        $widgets = [];

        //If the slot is declared in config
        if (!empty($slots[$slotId]) && !empty($slots[$slotId]['widgets'])) {
            //parse declared widgets
            $slotWidgets = array_keys($slots[$slotId]['widgets']);
        } elseif (!empty($options['availableWidgets'])) {
            $slotWidgets = $options['availableWidgets'];
        } else {
            //parse all widgets
            $slotWidgets = array_keys($availableWidgets);
        }

        foreach ($slotWidgets as $slotWidget) {
            $widgetParams = $availableWidgets[$slotWidget];
            $widgets[$slotWidget]['params'] = $widgetParams;
        }
        $slots[$slotId]['availableWidgets'] = $widgets;
        if (isset($options['max'])) {
            $slots[$slotId]['max'] = $options['max'];
        }

        return $slots[$slotId];
    }
public function computeOptions($slotId, $options = [])
    {
        $slots = $this->container->getParameter('victoire_core.slots');

        $availableWidgets = $this->container->getParameter('victoire_core.widgets');
        $widgets = [];

        //If the slot is declared in config
        if (!empty($slots[$slotId]) && !empty($slots[$slotId]['widgets'])) {
            //parse declared widgets
            $slotWidgets = array_keys($slots[$slotId]['widgets']);
        } elseif (!empty($options['availableWidgets'])) {
            $slotWidgets = $options['availableWidgets'];
        } else {
            //parse all widgets
            $slotWidgets = array_keys($availableWidgets);
        }

        foreach ($slotWidgets as $slotWidget) {
            $widgetParams = $availableWidgets[$slotWidget];
            $widgets[$slotWidget]['params'] = $widgetParams;
        }
        $slots[$slotId]['availableWidgets'] = $widgets;
        if (isset($options['max'])) {
            $slots[$slotId]['max'] = $options['max'];
        }

        return $slots[$slotId];
    }
public function computeOptions ( $ slotId , $ options = [ ] ) { $ slots = $ this -> container -> getParameter ( 'victoire_core.slots' ) ; $ availableWidgets = $ this -> container -> getParameter ( 'victoire_core.widgets' ) ; $ widgets = [ ] ; //If the slot is declared in config if ( ! empty ( $ slots [ $ slotId ] ) && ! empty ( $ slots [ $ slotId ] [ 'widgets' ] ) ) { //parse declared widgets $ slotWidgets = array_keys ( $ slots [ $ slotId ] [ 'widgets' ] ) ; } elseif ( ! empty ( $ options [ 'availableWidgets' ] ) ) { $ slotWidgets = $ options [ 'availableWidgets' ] ; } else { //parse all widgets $ slotWidgets = array_keys ( $ availableWidgets ) ; } foreach ( $ slotWidgets as $ slotWidget ) { $ widgetParams = $ availableWidgets [ $ slotWidget ] ; $ widgets [ $ slotWidget ] [ 'params' ] = $ widgetParams ; } $ slots [ $ slotId ] [ 'availableWidgets' ] = $ widgets ; if ( isset ( $ options [ 'max' ] ) ) { $ slots [ $ slotId ] [ 'max' ] = $ options [ 'max' ] ; } return $ slots [ $ slotId ] ; }
Compute slot options.

@param Slot  $slotId
@param array $options

@return string
Compute slot options .