You are here

function RendererBase::addNode in Forena Reports 8

Add a node to the existing dom element with attributes

Parameters

$cur_node DOMNode Parent node:

$indent Integer Text indentation.:

$tag String Tag name:

$value String text value of the element:

$attributes array Html attributes to add:

$frx_attributes array FRX attributes.:

Return value

\SimpleXMLElement The node added.

2 calls to RendererBase::addNode()
RendererBase::blockDiv in src/FrxPlugin/Renderer/RendererBase.php
Generate generic div tag.
RendererBase::setFirstNode in src/FrxPlugin/Renderer/RendererBase.php
Sets the first child element to a node and returns it. IF the node

File

src/FrxPlugin/Renderer/RendererBase.php, line 611
FrxRenderer.php Base class for FrxAPI custom Renderer @author davidmetzler

Class

RendererBase
Crosstab Renderer

Namespace

Drupal\forena\FrxPlugin\Renderer

Code

function addNode($cur_node, $indent, $tag = 'div', $value = '', $attributes = array(), $frx_attributes = array()) {
  $dom = $this->report->dom;
  if (!$cur_node) {
    return NULL;
  }
  if ($indent) {
    $tnode = $dom
      ->createTextNode("\n" . str_repeat(' ', $indent));
    $cur_node
      ->appendChild($tnode);
  }
  $node = $this->report->dom
    ->createElement($tag, $value);
  $cur_node
    ->appendChild($node);
  $this
    ->setAttributes($node, $attributes, $frx_attributes);
  $cur_node
    ->appendChild($this->report->dom
    ->createTextNode(""));
  return $node;
}