You are here

public function YoastSeoManager::getOverallScoreMarkup in Real-time SEO for Drupal 8

Get Markup for the overall score.

Parameters

int $score: The default score to display.

Return value

string HTML Markup of the overall score.

File

src/YoastSeoManager.php, line 312

Class

YoastSeoManager
Class YoastSeoManager.

Namespace

Drupal\yoast_seo

Code

public function getOverallScoreMarkup($score = 0) {
  $template = 'overall_score';
  $yoast_seo_manager = \Drupal::service('yoast_seo.manager');

  // Get template for the snippet.
  $overall_score_tpl = [
    '#theme' => $template,
    '#overall_score_target_id' => self::$jsTargets['overall_score_target_id'],
    '#overall_score' => $this
      ->getScoreStatus($score),
  ];
  return \Drupal::service('renderer')
    ->renderRoot($overall_score_tpl);
}