skeeks\cms\base\Widget::begin PHP Метод

begin() публичный статический Метод

This method creates an instance of the calling class. It will apply the configuration to the created instance. A matching Widget::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
Результат 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;
        //Если включена дебаг мод, будет напечатан первый тег
        echo $widget->_begin();
        return $widget;
    }

Usage Example

Пример #1
0
 public static function begin($config = [])
 {
     parent::begin($config);
     ob_start();
     ob_implicit_flush(false);
 }