TrackManiaControl/application/core/FML/Elements/Including.php

40 lines
631 B
PHP
Raw Normal View History

<?php
namespace FML\Elements;
2014-01-12 00:51:46 +01:00
use FML\Types\Renderable;
/**
2014-01-12 00:51:46 +01:00
* Include Element
*
* @author steeffeen
*/
class Including implements Renderable {
/**
2013-12-31 02:55:19 +01:00
* Protected Properties
*/
protected $tagName = 'include';
2014-01-12 00:51:46 +01:00
protected $url = '';
/**
2013-12-31 02:55:19 +01:00
* Set Url
*
2014-01-12 00:51:46 +01:00
* @param string $url Include Url
*/
public function setUrl($url) {
2014-01-12 00:51:46 +01:00
$this->url = (string) $url;
}
/**
*
* @see \FML\Renderable::render()
*/
public function render(\DOMDocument $domDocument) {
2014-01-12 00:51:46 +01:00
$xmlElement = $domDocument->createElement($this->tagName);
2013-12-31 02:55:19 +01:00
if ($this->url) {
2014-01-12 00:51:46 +01:00
$xmlElement->setAttribute('url', $this->url);
2013-12-31 02:55:19 +01:00
}
2014-01-12 00:51:46 +01:00
return $xmlElement;
}
}