By shyamala on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
Summary
html_tag is no longer available as a theme function. It has been converted to a pre-render callback instead to simplify and improve performance.
API change
Any calls to theme('html_tag'); or within a render array '#theme' => 'html_tag' need to be converted to '#type' => 'html_tag'. Drupal 8 core does not use this, but contributed modules need to note this.
Before:
$output = array(
'#theme' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'Generator',
'content' => 'Drupal 8',
),
);
After:
$output = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'Generator',
'content' => 'Drupal 8',
),
);
Before:
$meta_generator = array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'Generator',
'content' => 'Drupal 8',
),
);
$output = theme('html_tag', array('element' => $meta_generator));
After:
$meta_generator = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'Generator',
'content' => 'Drupal 8',
),
);
$output = drupal_render($meta_generator);
Impacts:
Module developers
Themers