function getHead(): string {
    /** @var \yii\web\View|null $view */
    $view = \Yii::$app->view;
    if (!$view || !$view->hasMethod('head')) return '';
    return $this->captureOutput([$view, 'head']);
  }