public function render($location, $zone = Zone::FRONTEND, $wrapperTemplate = 'widgetwrapper.twig')
    {
        $widgets = [];

        /** @var WidgetAssetInterface $widget */
        foreach ($this->sort($this->queue) as $widget) {
            if ($widget->getZone() !== $zone || $widget->getLocation() !== $location) {
                continue;
            }
            $html = $widget->isDeferred() ? null : $this->getHtml($widget);
            $widgets[] = ['object' => $widget, 'html' => $html];
        }

        if (empty($widgets)) {
            return null;
        }

        return $this->render->render($wrapperTemplate, ['location' => $location, 'widgets' => $widgets]);
    }
public function render($location, $zone = Zone::FRONTEND, $wrapperTemplate = 'widgetwrapper.twig')
    {
        $widgets = [];

        /** @var WidgetAssetInterface $widget */
        foreach ($this->sort($this->queue) as $widget) {
            if ($widget->getZone() !== $zone || $widget->getLocation() !== $location) {
                continue;
            }
            $html = $widget->isDeferred() ? null : $this->getHtml($widget);
            $widgets[] = ['object' => $widget, 'html' => $html];
        }

        if (empty($widgets)) {
            return null;
        }

        return $this->render->render($wrapperTemplate, ['location' => $location, 'widgets' => $widgets]);
    }
public function render ( $ location , $ zone = Zone :: FRONTEND , $ wrapperTemplate = 'widgetwrapper.twig' ) { $ widgets = [ ] ; /** @var WidgetAssetInterface $widget */ foreach ( $ this -> sort ( $ this -> queue ) as $ widget ) { if ( $ widget -> getZone ( ) !== $ zone || $ widget -> getLocation ( ) !== $ location ) { continue ; } $ html = $ widget -> isDeferred ( ) ? null : $ this -> getHtml ( $ widget ) ; $ widgets [ ] = [ 'object' => $ widget , 'html' => $ html ] ; } if ( empty ( $ widgets ) ) { return null ; } return $ this -> render -> render ( $ wrapperTemplate , [ 'location' => $ location , 'widgets' => $ widgets ] ) ; }
Render a location's widget.

@param string $location        Location (e.g. 'dashboard_aside_top')
@param string $zone            Either Zone::FRONTEND or Zone::BACKEND
@param string $wrapperTemplate Template file for wrapper

@return string|null
Render a location s widget .