I'm creating some custom modules for Drupal 8. They include some header modification for better Facebook integration. Here is what it looked like in Drupal 7 (SEVEN):
$element1 = array
(
'#tag' => 'meta',
'#attributes' => array
(
'property' => 'og:title',
'content' => " Profile: " . $record->NameFirst . " " . $record->NameLast,
),
);
drupal_add_html_head($element1, 'og_title');
But this drupal_add_html_head function is long long gone in Drupal 8. And I'm quite lost as to where to START attacking this. Maybe it's "Headerbag"? There's a Headerbag::add. Maybe it's in the module's return variable, possibly adding another element somewhere here:
return array(
'#markup' => t($pageContent),
);
Maybe HtmlResponseAttachmentsProcessor::setHeaders? HeaderBag::set? Session::setRequestHeader? PoStreamWriter::setHeader? PoMetadataInterface::setHeader?
Unfortunately, I can find pretty much no examples of how these are used. And I'm sure everyone here is familiar with the annoyance of having code that does work in previous versions that morphs into "doesn't work with no solution" in new code.