You are here

public function TestingAppService::reportLink in Forena Reports 8

Parameters

$text:

$fields:

Return value

mixed

Overrides AppService::reportLink

File

tests/src/Unit/Mock/TestingAppService.php, line 164

Class

TestingAppService

Namespace

Drupal\Tests\forena\Unit\Mock

Code

public function reportLink($text, $field) {
  $field['href'] = $field['link'];
  unset($field['link']);
  $field = array_filter($field);
  $attributes = '';
  foreach ($field as $key => $attr) {
    $attributes .= "{$key}='{$attr}' ";
  }
  $attributes = trim($attributes);
  return "<a {$attributes}>{$text}</a>";
}