You are here

public function cf_dom::get_markup in Common Functionality 7.2

Converts the body or head element into markup

Parameters

bool $include_tag: (optional) When TRUE, the head tag itself will be included in the output. When FALSE, only the contents of the tag will be included in the output. Defaults to FALSE.

bool $on_body: If TRUE, operate on body element. If FALSE, operate on head element. This defaults to TRUE.

Return value

string|bool The markup text that the object was converted from. FALSE on error.

File

modules/cf_dom/classes/cf_dom.php, line 262
Provides the cf_dom handling class.

Class

cf_dom
The cf_dom class assists in setting up and managing the custom dom object.

Code

public function get_markup($include_tag = FALSE, $on_body = TRUE) {
  if ($on_body) {
    if (!$this->body instanceof DOMNode) {
      if (class_exists('cf_error')) {
        cf_error::invalid_object('this->body');
      }
      return FALSE;
    }
    return $this
      ->p_get_markup($include_tag, $this->body);
  }
  if (!$this->head instanceof DOMNode) {
    if (class_exists('cf_error')) {
      cf_error::invalid_object('this->head');
    }
    return FALSE;
  }
  return $this
    ->p_get_markup($include_tag, $this->head);
}