public static function end()
    {
        if (!empty(static::$stack)) {
            $widget = array_pop(static::$stack);
            if (get_class($widget) === get_called_class()) {
                echo $widget->run();
                return $widget;
            } else {
                throw new InvalidCallException('Expecting end() of ' . get_class($widget) . ', found ' . get_called_class());
            }
        } else {
            throw new InvalidCallException('Unexpected ' . get_called_class() . '::end() call. A matching begin() is not found.');
        }
    }
public static function end()
    {
        if (!empty(static::$stack)) {
            $widget = array_pop(static::$stack);
            if (get_class($widget) === get_called_class()) {
                echo $widget->run();
                return $widget;
            } else {
                throw new InvalidCallException('Expecting end() of ' . get_class($widget) . ', found ' . get_called_class());
            }
        } else {
            throw new InvalidCallException('Unexpected ' . get_called_class() . '::end() call. A matching begin() is not found.');
        }
    }
public static function end ( ) { if ( ! empty ( static :: $ stack ) ) { $ widget = array_pop ( static :: $ stack ) ; if ( get_class ( $ widget ) === get_called_class ( ) ) { echo $ widget -> run ( ) ; return $ widget ; } else { throw new InvalidCallException ( 'Expecting end() of ' . get_class ( $ widget ) . ', found ' . get_called_class ( ) ) ; } } else { throw new InvalidCallException ( 'Unexpected ' . get_called_class ( ) . '::end() call. A matching begin() is not found.' ) ; } }
Ends a widget.
Note that the rendering result of the widget is directly echoed out.
@return static the widget instance that is ended.
@throws InvalidCallException if [[begin()]] and [[end()]] calls are not properly nested
Ends a widget . Note that the rendering result of the widget is directly echoed out .