head — Get the view’s header HTML.

Layout-related functions

Summary

This function includes the file header.php in a theme. A view script needs to use this function along with foot to create the structure of the page.

Get the view’s header HTML.

Parameters:
  • $vars (array) – Keyed array of variables

  • $file (string) – Filename of header script (defaults to ‘header’)

Returns:

string

Usage

Examples

You can use the $vars array to control the ‘id’ and ‘class’ information for the body element of a given page:

<?php echo head(array('bodyid'=>'home', 'bodyclass' =>'two-col')); ?>

While the page title is generated from the page metadata by default, you can set a page title manually by passing a ‘title’ to the head function:

<?php
$title = __('Explorations');
echo head(array('title' => $title, 'bodyclass' => 'explorations browse'));
?>

See Also