public function EasyRdf_Resource::htmlLink

Generates an HTML anchor tag, linking to this resource.

If no text is given, then the URI also uses as the link text.

Parameters

string $text Text for the link.:

array $options Associative array of attributes for the anchor tag:

Return value

string The HTML link string

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Resource.php, line 175

Class

EasyRdf_Resource
Class that represents an RDF resource

Code

public function htmlLink($text = null, $options = array()) {
  $options = array_merge(array(
    'href' => $this->uri,
  ), $options);
  if ($text === null) {
    $text = $this->uri;
  }
  $html = "<a";
  foreach ($options as $key => $value) {
    $html .= " " . htmlspecialchars($key) . "=\"" . htmlspecialchars($value) . "\"";
  }
  $html .= ">" . htmlspecialchars($text) . "</a>";
  return $html;
}