Bundle/WidgetBundle/Model/WidgetManager.php
public function newWidget($mode, $type, $slot, $view, $position, $parentWidgetMap, $quantum)
    {
        $quantum = $this->widgetFormBuilder->convertToString($quantum);

        $widget = $this->widgetHelper->newWidgetInstance($type, $view, $slot, $mode);
        $widgets = [$widget];

        /** @var BusinessEntity[] $classes */
        $classes = $this->cacheReader->getBusinessClassesForWidget($widget);
        $forms = $this->widgetFormBuilder->renderNewQuantumForms($slot, $view, $widgets, $widget, $classes, $position, $parentWidgetMap, $quantum);

        return [
            'widget' => $widget,
            'html'   => $this->templating->render(
                'VictoireCoreBundle:Widget:Form/new.html.twig',
                [
                    'id'              => time(),
                    'view'            => $view,
                    'slot'            => $slot,
                    'position'        => $position,
                    'parentWidgetMap' => $parentWidgetMap,
                    'classes'         => $classes,
                    'widgets'         => $widgets,
                    'widget'          => $widget,
                    'forms'           => $forms,
                ]
            ),
        ];
    }
public function newWidget($mode, $type, $slot, $view, $position, $parentWidgetMap, $quantum)
    {
        $quantum = $this->widgetFormBuilder->convertToString($quantum);

        $widget = $this->widgetHelper->newWidgetInstance($type, $view, $slot, $mode);
        $widgets = [$widget];

        /** @var BusinessEntity[] $classes */
        $classes = $this->cacheReader->getBusinessClassesForWidget($widget);
        $forms = $this->widgetFormBuilder->renderNewQuantumForms($slot, $view, $widgets, $widget, $classes, $position, $parentWidgetMap, $quantum);

        return [
            'widget' => $widget,
            'html'   => $this->templating->render(
                'VictoireCoreBundle:Widget:Form/new.html.twig',
                [
                    'id'              => time(),
                    'view'            => $view,
                    'slot'            => $slot,
                    'position'        => $position,
                    'parentWidgetMap' => $parentWidgetMap,
                    'classes'         => $classes,
                    'widgets'         => $widgets,
                    'widget'          => $widget,
                    'forms'           => $forms,
                ]
            ),
        ];
    }
public function newWidget ( $ mode , $ type , $ slot , $ view , $ position , $ parentWidgetMap , $ quantum ) { $ quantum = $ this -> widgetFormBuilder -> convertToString ( $ quantum ) ; $ widget = $ this -> widgetHelper -> newWidgetInstance ( $ type , $ view , $ slot , $ mode ) ; $ widgets = [ $ widget ] ; /** @var BusinessEntity[] $classes */ $ classes = $ this -> cacheReader -> getBusinessClassesForWidget ( $ widget ) ; $ forms = $ this -> widgetFormBuilder -> renderNewQuantumForms ( $ slot , $ view , $ widgets , $ widget , $ classes , $ position , $ parentWidgetMap , $ quantum ) ; return [ 'widget' => $ widget , 'html' => $ this -> templating -> render ( 'VictoireCoreBundle:Widget:Form/new.html.twig' , [ 'id' => time ( ) , 'view' => $ view , 'slot' => $ slot , 'position' => $ position , 'parentWidgetMap' => $ parentWidgetMap , 'classes' => $ classes , 'widgets' => $ widgets , 'widget' => $ widget , 'forms' => $ forms , ] ) , ] ; }
new widget.

@param string $type
@param string $slot
@param View   $view
@param int    $position

@return array
new widget .