skeeks\cms\traits\WidgetTrait::begin PHP Méthode

begin() public static méthode

This method creates an instance of the calling class. It will apply the configuration to the created instance. A matching WidgetTrait::end call should be called later.
public static begin ( array $config = [] ) : static
$config array name-value pairs that will be used to initialize the object properties
Résultat static the newly created widget instance
    public static function begin($config = [])
    {
        $config['class'] = get_called_class();
        /* @var $widget Widget */
        $widget = Yii::createObject($config);
        static::$stack[] = $widget;
        return $widget;
    }