function drupal_render_page

cis7 common.inc drupal_render_page($page)
cle7 common.inc drupal_render_page($page)
elmsmedia7 common.inc drupal_render_page($page)
icor7 common.inc drupal_render_page($page)
meedjum_blog7 common.inc drupal_render_page($page)
mooc7 common.inc drupal_render_page($page)

Renders the page, including all theming.

Parameters

$page: A string or array representing the content of a page. The array consists of the following keys:

  • #type: Value is always 'page'. This pushes the theming through page.tpl.php (required).
  • #show_messages: Suppress drupal_get_message() items. Used by Batch API (optional).

See also

hook_page_alter()

element_info()

2 calls to drupal_render_page()
drupal_deliver_html_page in includes/common.inc
Packages and sends the result of a page callback to the browser as HTML.
overlay_render_region in modules/overlay/overlay.module
Renders an individual page region.

File

includes/common.inc, line 5727
Common functions that many Drupal modules will need to reference.

Code

function drupal_render_page($page) {
  $main_content_display = &drupal_static('system_main_content_added', FALSE);

  // Allow menu callbacks to return strings or arbitrary arrays to render.
  // If the array returned is not of #type page directly, we need to fill
  // in the page with defaults.
  if (is_string($page) || (is_array($page) && (!isset($page['#type']) || ($page['#type'] != 'page')))) {
    drupal_set_page_content($page);
    $page = element_info('page');
  }

  // Modules can add elements to $page as needed in hook_page_build().
  foreach (module_implements('page_build') as $module) {
    $function = $module . '_page_build';
    $function($page);
  }
  // Modules alter the $page as needed. Blocks are populated into regions like
  // 'sidebar_first', 'footer', etc.
  drupal_alter('page', $page);

  // If no module has taken care of the main content, add it to the page now.
  // This allows the site to still be usable even if no modules that
  // control page regions (for example, the Block module) are enabled.
  if (!$main_content_display) {
    $page['content']['system_main'] = drupal_set_page_content();
  }

  return drupal_render($page);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.