TrackManiaControl/application/core/FML/Elements/Music.php
Steffen Schröder 345368df39 Huge FML Update
2014-05-01 17:34:56 +02:00

42 lines
683 B
PHP

<?php
namespace FML\Elements;
use FML\Types\Renderable;
/**
* Music Element
*
* @author steeffeen
*/
class Music implements Renderable {
/**
* Protected Properties
*/
protected $tagName = 'music';
protected $data = '';
/**
* Set Data Url
*
* @param string $data Media Url
* @return \FML\Elements\Music
*/
public function setData($data) {
$this->data = (string) $data;
return $this;
}
/**
*
* @see \FML\Renderable::render()
*/
public function render(\DOMDocument $domDocument) {
$xmlElement = $domDocument->createElement($this->tagName);
if ($this->data) {
$xmlElement->setAttribute('data', $this->data);
}
return $xmlElement;
}
}