FML/ManiaLinks.php
public function render($echo = false)
    {
        $domDocument                = new \DOMDocument("1.0", "utf-8");
        $domDocument->xmlStandalone = true;
        $maniaLinks                 = $domDocument->createElement("manialinks");
        $domDocument->appendChild($maniaLinks);

        foreach ($this->children as $child) {
            $childXml = $child->render(false, $domDocument);
            $maniaLinks->appendChild($childXml);
        }

        if ($this->customUI) {
            $customUIElement = $this->customUI->render($domDocument);
            $maniaLinks->appendChild($customUIElement);
        }

        if ($echo) {
            header("Content-Type: application/xml; charset=utf-8;");
            echo $domDocument->saveXML();
        }

        return $domDocument;
    }
public function render($echo = false)
    {
        $domDocument                = new \DOMDocument("1.0", "utf-8");
        $domDocument->xmlStandalone = true;
        $maniaLinks                 = $domDocument->createElement("manialinks");
        $domDocument->appendChild($maniaLinks);

        foreach ($this->children as $child) {
            $childXml = $child->render(false, $domDocument);
            $maniaLinks->appendChild($childXml);
        }

        if ($this->customUI) {
            $customUIElement = $this->customUI->render($domDocument);
            $maniaLinks->appendChild($customUIElement);
        }

        if ($echo) {
            header("Content-Type: application/xml; charset=utf-8;");
            echo $domDocument->saveXML();
        }

        return $domDocument;
    }
public function render ( $ echo = false ) { $ domDocument = new \ DOMDocument ( "1.0" , "utf-8" ) ; $ domDocument -> xmlStandalone = true ; $ maniaLinks = $ domDocument -> createElement ( "manialinks" ) ; $ domDocument -> appendChild ( $ maniaLinks ) ; foreach ( $ this -> children as $ child ) { $ childXml = $ child -> render ( false , $ domDocument ) ; $ maniaLinks -> appendChild ( $ childXml ) ; } if ( $ this -> customUI ) { $ customUIElement = $ this -> customUI -> render ( $ domDocument ) ; $ maniaLinks -> appendChild ( $ customUIElement ) ; } if ( $ echo ) { header ( "Content-Type: application/xml; charset=utf-8;" ) ; echo $ domDocument -> saveXML ( ) ; } return $ domDocument ; }
Render the ManiaLinks object

@param bool (optional) $echo If the XML text should be echoed and the Content-Type header should be set
@return \DOMDocument
Render the ManiaLinks object