Huge FML Update
This commit is contained in:
49
application/core/FML/ManiaCode/Go_To.php
Normal file
49
application/core/FML/ManiaCode/Go_To.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace FML\ManiaCode;
|
||||
|
||||
/**
|
||||
* ManiaCode Element going to a Link
|
||||
*
|
||||
* @author steeffeen
|
||||
*/
|
||||
class Go_To implements Element {
|
||||
/**
|
||||
* Protected Properties
|
||||
*/
|
||||
protected $tagName = 'goto';
|
||||
protected $link = '';
|
||||
|
||||
/**
|
||||
* Construct a new Go_To Element
|
||||
*
|
||||
* @param string $link (optional) Goto Link
|
||||
*/
|
||||
public function __construct($link = null) {
|
||||
if ($link !== null) {
|
||||
$this->setLink($link);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Goto Link
|
||||
*
|
||||
* @param string $link Goto Link
|
||||
* @return \FML\ManiaCode\Go_To
|
||||
*/
|
||||
public function setLink($link) {
|
||||
$this->link = (string) $link;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$linkElement = $domDocument->createElement('link', $this->link);
|
||||
$xmlElement->appendChild($linkElement);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user