skeeks\cms\base\Widget::end PHP Method

end() public static method

Note that the rendering result of the widget is directly echoed out.
public static end ( ) : static
return static the widget instance that is ended.
    public static function end()
    {
        if (!empty(static::$stack)) {
            $widget = array_pop(static::$stack);
            if (get_class($widget) === get_called_class()) {
                echo $widget->run();
                //В режиме редактирования, будет добавлен закрывающий тег + зарегистрированные данные для js
                echo $widget->_end();
                return $widget;
            } else {
                throw new InvalidCallException(\Yii::t('skeeks/cms', '"Expecting end() of {widget}, found {class}', ['widget' => get_class($widget), 'class' => get_called_class()]));
            }
        } else {
            throw new InvalidCallException(\Yii::t('skeeks/cms', "Unexpected {class}::end() call. A matching begin() is not found.", ['class' => get_called_class()]));
        }
    }