protected function getHtml(WidgetAssetInterface $widget)
    {
        $key = 'widget_' . $widget->getKey();
        if ($html = $this->cache->fetch($key)) {
            return $html;
        }

        $html = Thrower::call([$widget, '__toString']);

        if ($widget->getCacheDuration() !== null) {
            $this->cache->save($key, $html, $widget->getCacheDuration());
        }

        return $html;
    }
protected function getHtml(WidgetAssetInterface $widget)
    {
        $key = 'widget_' . $widget->getKey();
        if ($html = $this->cache->fetch($key)) {
            return $html;
        }

        $html = Thrower::call([$widget, '__toString']);

        if ($widget->getCacheDuration() !== null) {
            $this->cache->save($key, $html, $widget->getCacheDuration());
        }

        return $html;
    }
protected function getHtml ( WidgetAssetInterface $ widget ) { $ key = 'widget_' . $ widget -> getKey ( ) ; if ( $ html = $ this -> cache -> fetch ( $ key ) ) { return $ html ; } $ html = Thrower :: call ( [ $ widget , '__toString' ] ) ; if ( $ widget -> getCacheDuration ( ) !== null ) { $ this -> cache -> save ( $ key , $ html , $ widget -> getCacheDuration ( ) ) ; } return $ html ; }
Get the HTML content from the widget.

@param WidgetAssetInterface $widget

@throws \Exception

@return string
Get the HTML content from the widget .