You are here

protected function W3CLogController::buildValidationDisplay in W3C Validator 8

Helper method to build the result row ready to display.

Parameters

array $page: The page to validate, as per stored in DB from this module.

array $validation: An array of preprocess validation values for that page.

Return value

array A formAPI array representing a result row ready to display.

1 call to W3CLogController::buildValidationDisplay()
W3CLogController::overview in src/Controller/W3CLogController.php
Return the 'overview' page.

File

src/Controller/W3CLogController.php, line 188

Class

W3CLogController
Controller routines for w3c_validator module validation log routes.

Namespace

Drupal\w3c_validator\Controller

Code

protected function buildValidationDisplay(array $page, array $validation) {
  $display = [
    '#type' => 'container',
    '#attributes' => [
      'class' => [
        'page-summary',
      ],
    ],
  ];
  $display['icon'] = [
    '#prefix' => '<span class="icon">',
    '#suffix' => '</span>',
  ];
  $display['title'] = [
    '#prefix' => '<span class="title">',
    '#suffix' => '</span>',
    '#markup' => $page['title'],
  ];
  $display['result'] = [
    '#prefix' => '<span class="result">',
    '#suffix' => '</span>',
    '#markup' => $validation['result'],
  ];
  $display['status'] = [
    '#prefix' => '<span class="status">',
    '#suffix' => '</span>',
    '#markup' => $validation['status'],
  ];
  return $display;
}